static-files

Subdirectories not being served with express.static in heroku

社会主义新天地 提交于 2019-12-03 20:21:19
I'm seeing some really odd behavior where some of my files are correctly being returned by my express/node server (using express.static() ), but not files within subdirectories. The frustrating thing is that it works fine using node or foreman locally, it just won't work on heroku. This gist has the main files at play here, and my app structure looks like this: -app - index.html - img/ - base.png - sub/ - sub.png - scripts - base.js - sub/ - sub.js - css - base.css - sub/ - sub.css - server - app.js The index.html, and base.* files all load fine, it's just the sub.* files that 404. Seems

What is the best way to optimize a Windows Server 2008 box running IIS7 to serve only static files?

两盒软妹~` 提交于 2019-12-03 17:17:18
I would like to have our web applications pull static content (css, js, images) from a static file server running Windows Server 2008 and IIS7. What sort of optimizations would you make to the server for this single purpose? (Machine.config changes? Web.config changes? Special IIS7 setup or modules? What?) Some advices: Enable gzip compression: http://blogs.msdn.com/vivekkum/archive/2009/02/18/http-compression-in-iis-6-and-iis-7-using-service-account.aspx Set Cache-Control: max-age to 31536000 (1 year). code.google.com will tell you why --> http://code.google.com/speed/page-speed/docs/caching

Learning Node - Express Public folder not working

断了今生、忘了曾经 提交于 2019-12-03 14:58:54
问题 So I'm new to node and trying to learn how to use the express library with it. However, the problem I'm trying to figure out is why the files in my /public folder do not seem to be served as static content. Here's my code: var http = require('http'); var port = process.env.port || 1337; var express = require('express'); var handlebars = require('express3-handlebars'); var path = require('path'); var application = express(); application.use(express.static(path.join(__dirname, 'public')));

Load static files for all templates in django

风流意气都作罢 提交于 2019-12-03 11:46:02
Is there a way in django to not need the {% load static %} at the top of every template? This question indicates you can factor out common load tags into settings, but doesn't give the particulars you need in this case. As of django 1.9, you can add the following to your template settings: 'builtins': ['django.contrib.staticfiles.templatetags.staticfiles'] For example, the whole template setting might look like this: TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context

Can I have koa-static serve assets at a custom (e.g., /static/) path?

℡╲_俬逩灬. 提交于 2019-12-03 11:07:55
The docs at https://github.com/koajs/static and my personal experience trying out koa-static lead me to believe that you can only serve files from the root URL of your app. For example: app.use(serve('./some/dir/')); Given the above use of serve , the URL to access a file ./some/dir/something.txt would be localhost:3000/something.txt . There doesn't seem to be a way to configure my app such that the same file (and all other files in the same dir) is served at localhost:3000/static/something.txt instead. I'm new to Node and to Koa, so I've just begun to dive into this and I'm probably missing

ASP.NET MVC application gives Internal Server Error only when viewed in Firefox

两盒软妹~` 提交于 2019-12-03 10:17:53
(I'm new to .Net and the Microsoft world in general, coming from a Java and Tomcat background, so please bear that in mind.) I'm working on my first .Net application, using Visual Studio 2013, C#, .Net 4.5, MVC 5, and EF 6. It's a fairly simple web-based application, using Windows authentication and Active Directory groups for authorization to do fairly basic CRUD operations on a table in a SQL Server database. I haven't deployed the application yet. I'm still developing it and testing it out on my PC (running Windows 7). When I hit Ctrl-F5 to test out the application in Internet Explorer or

Problems linking to static files in Django 1.3

亡梦爱人 提交于 2019-12-03 07:59:26
I'm running django 1.3, python 2.7 on windows XP I'm trying to setup a css in a static folder for my django app. The template looks like: <html> <head> <title>css demo</title> <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/my.css" /> </head> <body> The generated HTML looks like: <html> <head> <title>css demo</title> <link rel="stylesheet" type="text/css" href="http://localhost/static/css/my.css" /> </head> ... So it appears that I have everything set up in order to specify where the static files are in the template, and then in the generated html. But there is noting at '

Rails 3.1, Unicorn and Apache: static files

前提是你 提交于 2019-12-03 07:02:27
I have Rails 3.1, Unicorn and Apache setup. My Apache settings are below and production.rb looks like this . I like using h264 streaming but since Rails is serving these video files, the Apache Mod won't work. DocumentRoot /blabla/current/public RewriteEngine On Options FollowSymLinks <Proxy balancer://unicornservers> BalancerMember http://127.0.0.1:4000 </Proxy> # Redirect all non-static requests to rails RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://unicornservers%{REQUEST_URI} [P,QSA,L] ProxyPass / balancer://unicornservers/ ProxyPassReverse / balancer:

Learning Node - Express Public folder not working

拈花ヽ惹草 提交于 2019-12-03 05:41:46
So I'm new to node and trying to learn how to use the express library with it. However, the problem I'm trying to figure out is why the files in my /public folder do not seem to be served as static content. Here's my code: var http = require('http'); var port = process.env.port || 1337; var express = require('express'); var handlebars = require('express3-handlebars'); var path = require('path'); var application = express(); application.use(express.static(path.join(__dirname, 'public'))); application.engine('handlebars', handlebars({ defaultLayout: 'main' })); application.get('/', function(req,

Start an apache server in any directory from command line

99封情书 提交于 2019-12-03 05:40:45
问题 I want to be able to start an apache server from the command line, typing something like apache site-folder or apache . --port=2000 This should read and use .htaccess files. I know about python -m SimpleHTTPServer and it's close to what I need, but not quite. Ideal solutions: Contributing a great command line interface to apache itself Writing a simple command line tool that wraps/contains apache (or something) Linking to docs on an existing cli for apache I just want to type command