新版本webpack生成的dev.server.js 在webpack.dev.conf.js中 webpack.dev.conf.js const axios = require('axios') const express = require('express') const app = express() const apiRoutes = express.Router() app.use('/api', apiRoutes) 而後找到devserver 這裏能夠配置路由 devServer: { before (app) { app.get('/api/getDiscList', function (req, res) { res.json }) },