Last active
August 31, 2018 03:25
-
-
Save varHarrie/2a41c665038b46ee1d18ff74474321eb to your computer and use it in GitHub Desktop.
Parcel Proxy https://github.com/parcel-bundler/parcel/issues/55
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const proxy = require('http-proxy-middleware') | |
const Bundler = require('parcel-bundler') | |
const bundlerOptions = { cache: false } | |
const proxyOptions = { target: 'http://localhost:3000' } | |
const app = express() | |
const bundler = new Bundler('src/index.html', bundlerOptions) | |
app.use('/api', proxy(proxyOptions)) | |
app.use(bundler.middleware()) | |
app.listen(Number(process.env.PORT || 1234)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment