Parcel: Proxy support?

Created on 16 Jun 2018  路  6Comments  路  Source: parcel-bundler/parcel

I currently use http-server to serve my SPA app on localhost:8080, but I set a proxy to localhost:3000 where I have my express server running with a REST API.

With http-server the -P flag proxies all requests which can't be resolved locally to a given URL.

For example, my serve command is:
http-server dist -c 1 -a localhost -P http://localhost:3000/

Is there an equivalent proxy flag for parcel serve?

All 6 comments

Currently not. But you can use parcel as middleware in your express application

There have been plenty of issues about this in the past. @KeineLimonade is correct - you can use the middleware to build your own proxy pretty easily so we won't support it in parcel core.

But what if you're using Koa? I don't think it would work :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidnagli picture davidnagli  路  3Comments

algebraic-brain picture algebraic-brain  路  3Comments

will-stone picture will-stone  路  3Comments

urbanhop picture urbanhop  路  3Comments

davidnagli picture davidnagli  路  3Comments