Any way to serve files in root path of my domain?
See original GitHub issueHi~
I have look at static-file-serving, but it must put files in static
folder.
If I need put a file verify_xx.txt
in root path of my domain to visit it, such as www.abc.com/verify_xx.txt
where nextjs deploy at www.abc.com
, how can I do?
except write a special node/koa router for all these files?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Find the Document Root of your Website - InMotion Hosting
In this article, we will explain the public_html folder, your website's document root, and add-on and subdomains doc root.
Read more >Serving Static Content | NGINX Plus
Configure NGINX and NGINX Plus to serve static content, with type-specific root directories, checks for file existence, and performance optimizations.
Read more >How to make a file look like it is in the root directory on server
Make sure your webserver is configured to read .htaccess files: AllowOverride directive in your vhost configuration. Usual value would be AllowOverride All; You ......
Read more >Serve files from directory to / and index.html at the same time
An easy way would be to move static files inside your main root folder. You could do a rewrite to hide the real...
Read more >Serving static files in Express
The root argument specifies the root directory from which to serve static assets. For more information on the options argument, see express.static.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We’re adding support for this soon!
Please see https://github.com/zeit/next.js/issues/7177
@lucasfeliciano Thanks, it works!
I use:
It would be great if nextjs could done this just by a simple config, for example in
next.config.js
: