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.

[RFC] Serving static files from the root

See original GitHub issue

Feature request

Is your feature request related to a problem? Please describe.

After seeing some custom server.js usage a clear pattern is people using it to define static file serving from the root. For example for robots.txt or google site verification and other files that have to be served from the root.

Describe the solution you’d like

Ideally users would not have to define this. The common way root serving has been solved is through a public directory.

For example:

Notes

This also needs to be applied to @now/next when implemented.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:54
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
digigarlabcommented, May 5, 2019

I think public/ is more explicit. In fact I already have a public/ folder that I copy manually to out during the export:

async exportPathMap(defaultMap) {
  //...
  await copy('./public', './out')

  return defaultMap
}
3reactions
timneutkenscommented, Apr 27, 2019

One implementation detail that we have to figure out is which are preferred: pages or public directory. I think it should be pages first.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Flask serving static files from root static folder rather ...
Hey, thank you for responding. I tried removing the static_folder and static_url_path variables, but it is still making the request to "GET / ......
Read more >
Serving static files in Express
To serve static files such as images, CSS files, and JavaScript files, ... The root argument specifies the root directory from which to...
Read more >
RFC 8806: Running a Root Server Local to a Resolver
This design explicitly only allows the new root zone service to be run on the same server as the recursive resolver in order...
Read more >
Serve static files with HTTP::Server::Simple - manpages.ubuntu!
serve_static( $cgi, $base ) Takes a reference to the CGI object and a document root path, and tries to serve a static file....
Read more >
Mojolicious::Static - Serve static files
Mojolicious::Static is a static file server with Range , If-Modified-Since and If-None-Match support, based on RFC 7232 and RFC 7233.
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