Created
September 25, 2018 03:32
-
-
Save huang-xiao-jian/9df566da4285600d385b6db5b1d843fe to your computer and use it in GitHub Desktop.
webpack server configuration
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
/** | |
* @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