vue模拟接口数据

在build/dev-server.js文件下
const app = express()

var appData = require('../goods.json')
var goods = appData.goods
var apiRoutes = express.Router()
apiRoutes.get('/goods', function(req, res) {
res.json({
data: goods
})
})
app.use('/api', apiRoutes)
posted @ 2017-10-14 00:17  hahaha222  阅读(446)  评论(0编辑  收藏  举报