Serve: Add support for 'basepath' option

Created on 4 May 2017  路  2Comments  路  Source: vercel/serve

As per nws docs

If you want all requests to resolve to a base path (i.e. http://localhost:3030/basepath) without having to place all files into a src/basepath sub-directory, use the -b flag:

nws -b basepath

This means allows you to mount the server on different path contexts.

review needed

Most helpful comment

Hi leo, can you document how to implement this using rewrites or redirects? It seems like it should be straightforward to do so but I haven't been able to do it correctly.

All 2 comments

Thanks for the effort you've put into researching this, but I think the project is already way too complex. In turn, I don't think it's good idea to support such an edge case.

I hope you understand that! 馃槉

Hi leo, can you document how to implement this using rewrites or redirects? It seems like it should be straightforward to do so but I haven't been able to do it correctly.

Was this page helpful?
0 / 5 - 0 ratings