static-files

Route to static file in Play! 2.0

為{幸葍}努か 提交于 2019-12-03 01:56:53
问题 I'm trying to make a route to a specific static file but everything I'm trying ends with an error. I've made 3 different attempts: 1. GET /file staticFile:/public/html/file.html The error I get: Compilation error string matching regex `\z' expected but `:' found 2. GET /file controllers.Assets.at(path="/public/html", "file.html") The error I get: Compilation error Identifier expected 3. GET /file controllers.Assets.at(path="/public/html", file="file.html") The error I get: (and this is the

Serve files from folder outside web application in Jetty

瘦欲@ 提交于 2019-12-02 19:45:48
I have a Java web application (Eclipse/OSGI) on a Jetty server. I want to be able to serve static files to my web application from a folder outside of the web root. In my web application, I don't yet know the file name of the file I want to be served, so I want to take the filename (and/or path) as a VM parameter when I start my web application. For example: I have an image - myImg.jpg - that I have put in a folder on the server file system, for example root/images/myImg.jpg. I want to take this as a VM parameter, e.g. "-DmyImg=/images/myImg.jpg/" so that I can get the image and display it on

Problem applying css in Django with static-files app

懵懂的女人 提交于 2019-12-02 19:34:40
问题 I am using Django and I can't get my style.css to work. Every time I load the page I am working on, no css is applied. Also I get this in the terminal "GET /css/style.css HTTP/1.1" 404 2239 My style.css is located in .../Templates/site_media/static/css I also have djago.contrib.staticfiles in my INSTALLED_APPS I have this in my settings.py STATIC_URL = '/static/' STATICFILES_DIRS = "/Templates/site_media/", This is what I have in my template to load the css <link href="{{STATIC_URL}}css/style

Route to static file in Play! 2.0

折月煮酒 提交于 2019-12-02 15:32:52
I'm trying to make a route to a specific static file but everything I'm trying ends with an error. I've made 3 different attempts: 1. GET /file staticFile:/public/html/file.html The error I get: Compilation error string matching regex `\z' expected but `:' found 2. GET /file controllers.Assets.at(path="/public/html", "file.html") The error I get: Compilation error Identifier expected 3. GET /file controllers.Assets.at(path="/public/html", file="file.html") The error I get: (and this is the weirdest) Compilation error not enough arguments for method at: (path: String, file: String)play.api.mvc

Problem applying css in Django with static-files app

自古美人都是妖i 提交于 2019-12-02 11:34:53
I am using Django and I can't get my style.css to work. Every time I load the page I am working on, no css is applied. Also I get this in the terminal "GET /css/style.css HTTP/1.1" 404 2239 My style.css is located in .../Templates/site_media/static/css I also have djago.contrib.staticfiles in my INSTALLED_APPS I have this in my settings.py STATIC_URL = '/static/' STATICFILES_DIRS = "/Templates/site_media/", This is what I have in my template to load the css <link href="{{STATIC_URL}}css/style.css" rel="stylesheet" type="text/css" > My style.css is located in .../Templates/site_media/static/css

IIS, denying access to static files; What is wrong with this example?

女生的网名这么多〃 提交于 2019-12-02 11:14:04
问题 I am trying to get the simplest example of allowing access by default, denying access unless authenticated to specific directories in IIS, to work. When you Google around, everyone says it's as simple as this: <location path="~/pages"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location> Somehow it hasn't been for me. Here's the project structure: Here's the Web.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.web> <authentication

IIS, denying access to static files; What is wrong with this example?

China☆狼群 提交于 2019-12-02 07:38:41
I am trying to get the simplest example of allowing access by default, denying access unless authenticated to specific directories in IIS, to work. When you Google around, everyone says it's as simple as this: <location path="~/pages"> <system.web> <authorization> <deny users="?"/> </authorization> </system.web> </location> Somehow it hasn't been for me. Here's the project structure: Here's the Web.config: <?xml version="1.0" encoding="utf-8"?> <configuration> <system.web> <authentication mode="Forms"> <forms loginUrl="~/" /> </authentication> <authorization> <!--<deny users="*"/>--> <

Serve static files from blueprints without url prefix

不羁的心 提交于 2019-12-01 11:13:32
问题 For development, I'd like to serve static files from the blueprint's static folder. However, I don't want to load all files via the url prefix of the blueprint. Is there a possibility to configure flask, so it looks in all blueprint's static folders and returns the first file it finds? The reason for this is that when I deploy the application, the build process will pull all the files our of the blueprints and put them into a separate folder (similar to Django's collectstatics). In other

Node.js static file server logic (using Connect middleware)

让人想犯罪 __ 提交于 2019-12-01 10:26:18
问题 Let's say I have the following filesystem structure: /app/ Main application folder /app.js Server JS file ran by node.js /public Folder containing files for public website (port 80) /index.html /js/ /game.js /admin/ Folder containing files used by local network system (port X) /index.html /js/ /screen.js /share/ Folder containing files to be used by public website OR lan /js/ /jquery.js The end result is that admin/index.html would look like: <script type="text/javascript" src="/js/jquery.js"

Loop through all files/images in a folder with Angular

拈花ヽ惹草 提交于 2019-12-01 06:40:24
I have an app with some products and each product has a gallery with a different amount of images. Each of the images has a name that is completely random / no correlation with the other image names. Each of the product images are in /src/assets/images/products/:id/ . I need to add the paths to a gallery component but I can't loop through them because the names are random. Is there any way to just loop through each file from a folder using only Angular? If not can I do it on the back-end without renaming the files? I'm also running the app on a Node.js back-end if that matters. Radonirina