I have a php file under of static folder.
How can i browse the php file?
I tried to use a proxy on config, but its not working
/pages
/static
test.php
How could i browse it
localhost:port/[proxy]/test.php
Thanks
I guess you would need a webserver to handle your .php file.
/static folder is for static content.
This is what i found in the documentation:
If you don't want to use Webpack assets from the assets directory, you can create and use the static directory (in your project root folder).
All included files will be automatically served by Nuxt and are
accessible through your project root URL. (static/favicon.ico will be
available at localhost:3000/favicon.ico)
https://nuxtjs.org/guide/assets/#static
Related
I have a Nuxt.js app with an .htaccess file.
The problem is that when I execute nuxt generate in the terminal, my .htaccess file disappears. What can I do to include my .htaccess file when I execute nuxt generate?
You could put your .htaccess file into the /static directory, more info on that in the doc.
That way, you will have direct access to it once pushed to production.
Otherwise, you can also use this approach if you need something more customizable.
I am using IntelliJ to edit a Next.js website.
IntelliJ IDEA 2020.2.1
Next.js 9.5.3-canary.23
Next.js static file serving uses a /public directory as a container for static assets, but when publishing a Next.js site, the contents of the public directory are hosted at the root of the site.
So, as shown in the linked doco, an image that exists in the codebase at /public/my-image.png is addressed by an URL path of src="/my-image.png".
This confuses IntelliJ and it shows a warning that it can't resolve the directory of the img src:
I tried marking the /public directory as a "Source root" or a "Resources root" - but that didn't make the warning go away.
I also tried adding the /public directory as a "Content root", but IntelliJ doesn't want to do that because it overlaps with the root directory of the module, which is already a content root.
Is there any way to tell idea to look in the /public directory for statically referenced assets like this?
I've had the same problem. In my case, "Mark Directory as > Resource Root" worked well.
Before...
Right click ./public. Then Mark Directory as > Resource Root
After...
Image loads.
I have a working Nuxt website configured using Nginx web server.
What I want to do is that I want to run some demo PHP script from a folder called demo which is placed inside root folder of the project.
Now if I access it like this: http://mywebsite.com/demo/test.php
It works fine but If I add a folder with more scripts and css files like this
http://mywebsite.com/demo/todo_list/index.php
Here the index.php is loaded with some images, css and js files. But the page on browser only executes the php code. It can't load any resources like js, css and image files.
Basically I want this folder to be independent so I can do my research work from this folder making it completely independent from Nuxt.
How can I do this?
Nevermind, I figured out.
Just had to add one more rule inside nginx config file as below
# Demo Folder
location /demo/ {
try_files $uri $uri/ /index.php$is_args$args;
}
Trying to use the aurelia cli bundling facility.
Is it possible to serve all app files (i.e. index.html, app-bundle.html, app-bundle.js, etc) from a single directory or index.html must be at the top (./) directory and the other files in a child (./dist) directory?
Under the covers the cli is using JSPM / System.js's bundling functionality. This works by looking at your config.js paths on where to find the files both for the bundle and when serving. If your paths are set up to serve from the root directory this should work as expected. The problem will be that if you are trying to bundle root it will try to grab all .js files in there which could be bad if you don't exclude them.
In my /var/www/ i have:
my_project
|-app
|-controllers
|-models
|-views
|-core
|-css
|-js
|-public
|-index.php
I have set up "DirectoryRoot" to:
/var/www/my_project/public/
Now when i open web page in browser my views are loaded but links to files in css and js folders don't work. It looks like I can't go one directory up. What am i doing wrong ?