parcel-bundler browsersync server proxy example
parcel-bundler's dev server does not provide a server proxy for the rest api.
so, I bundled through parcel-bundler using js files and use browser-sync and proxy middleware to communicate with the REST api server.
fork github repo.
git clone https://github.com/trustyoo86/parcel-browsersync-proxy-example.git
Run npm install or yarn install in the project folder
# npm
npm install
# yarn
yarn install
Run the express server at the terminal
# npm
npm run server
# yarn
yarn server
Run the dev mode of parcel-bundler another termnial
# npm
npm run dev
# yarn
yarn dev
Run the express server at the terminal with NODE_ENV=production
# npm
npm run prod
# yarn
yarn prod