Skip to content

Instantly share code, notes, and snippets.

@huang-xiao-jian
Created September 25, 2018 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huang-xiao-jian/9df566da4285600d385b6db5b1d843fe to your computer and use it in GitHub Desktop.
Save huang-xiao-jian/9df566da4285600d385b6db5b1d843fe to your computer and use it in GitHub Desktop.
webpack server configuration
/**
* @description - webpack server configurations
* @author - huang.jian <hjj491229492@hotmail.com>
*/
const convert = require('koa-connect');
const history = require('connect-history-api-fallback');
const proxy = require('http-proxy-middleware');
module.exports = {
add: (app) => {
app.use(
convert(proxy('/story', { target: 'https://story.babycherry.cn' }))
);
app.use(convert(history()));
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment