Closed elliottregan closed 7 years ago
There is to ways to deal with backend requests with the BrowserSync server. First, you request another URL and have to deal with URL configuration and CORS on your server. Second, you setup a proxy middleware in your BrowserSync, there are some ready to use on NPM (BrowserSync is compatible with Express middlewares).
In production, you absolutely should not use BrowserSync. Fountain provides a build
task which generate a dist
folder which is ready to use with any static HTTP server.
Thanks!
Prerequisites
I'm using the VueJS generator, but this should apply to any generator. I know that questions are best asked on Slack or SO, but those communities are pretty dead at the moment.
Description
I'm looking to set up some simple GET and POST requests. Should I accomplish that with BrowserSync's middleware, or something else?
In the same vein as that, what is the intention when going to production? I assume you don't intend for BrowserSync to run in production. Should I be setting up separate Gulp tasks to serve my files without BrowserSync?