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?
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 :(