question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Any way to serve files in root path of my domain?

See original GitHub issue

Hi~

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:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Timercommented, Apr 29, 2019

We’re adding support for this soon!

Please see https://github.com/zeit/next.js/issues/7177

1reaction
tangbccommented, Jan 30, 2019

@lucasfeliciano Thanks, it works!

I use:

path.resolve(`static${path}`)

It would be great if nextjs could done this just by a simple config, for example in next.config.js:

module.exports = {
    rootServeDir: 'rootAssets'
}
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found