lukeed / sirv

An optimized middleware & CLI application for serving static files~!
MIT License
1.06k stars 56 forks source link

Question: is there a way to specify the assets access path? #78

Closed ghost closed 4 years ago

ghost commented 4 years ago

For example: sirv('../assets', { accessPath: 'assets' }). This should allow requests to Express.js to access the '../assets' directory using 'assets'. As is, without this option, I get 404.

lukeed commented 4 years ago

Sirv is a middleware, not a router. You use Express/Polka to setup the router.

app()
  .use('/assets', sirv('/path/to/assets'))
  // ...

Hope that helps~