在webpack-dev-conf.js中修改
1.
const express = require('express')
const app = express()
var appData = require('../data.json')
var seller = appData.data
var apiRoutes = express.Router()
app.use('/api', apiRoutes)
2.
before(app) {
app.get('/api/data', (req, res) => {
res.json({
errno: 0,
data: data
});
}),
2.重新 npm run dev