Skip to content
This repository has been archived by the owner on Jan 14, 2020. It is now read-only.

rootStaticFiles #62

Closed
egoist opened this issue Oct 6, 2017 · 2 comments
Closed

rootStaticFiles #62

egoist opened this issue Oct 6, 2017 · 2 comments
Milestone

Comments

@egoist
Copy link
Collaborator

egoist commented Oct 6, 2017

Instead of directly serving the whole static folder at /:path*:

https://github.com/ream/ream/blob/d96bae0f853a37b1d2955994f9ce1c73da92b24a/packages/ream-core/lib/index.js#L157-L165

We should still copy static to output folder and add an option rootStaticFiles to serve files in output folder to root path, eg:

/_ream/favicon.ico will also be served as /favicon.ico when you have rootStaticFiles: ['favicon.ico']


Furthur changes for folder serving strategy:

  • public will be served through http server as /public (not sure why we need this)
  • static will be copied to dist/static instead of dist, then you can access it via /_ream/static
  • Importing static file in your app will generate files in dist/assets instead of dist/static
@egoist egoist added the 2.0 label Oct 6, 2017
@egoist egoist added this to the 2.0 milestone Oct 6, 2017
@egoist
Copy link
Collaborator Author

egoist commented Dec 5, 2017

In short, ./static/foo.txt on your disk will be available at http://localhost:5000/_ream/static/foo.txt, and with option: rootStaticFiles: ['foo.txt'], it will be hoisted to http://localhost:5000/foo.txt

@egoist egoist closed this as completed in d625796 Dec 5, 2017
@egoist
Copy link
Collaborator Author

egoist commented Dec 5, 2017

We now hoist all files in static folder to root path, so rootStaticFiles is not needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant