1.build --> dev-server.js
var app = express()
//
var appData = require("../data.json");
// console.log(appData);
var seller = appData.seller;
var goods = appData.goods;
var ratings=appData.ratings;
var apiRoutes=express.Router();
//商家数据
apiRoutes.get('/seller',function (req,res) {
res.json({
errno:0,
data:seller,
});
});
//商品数据
apiRoutes.get('/goods',function (req,res) {
res.json({
errno:0,
data:goods,
});
});
//评论数据
apiRoutes.get('/ratings',function (req,res) {
res.json({
errno:0,
data:ratings,
});
});
app.use('/api',apiRoutes);
//
var compiler = webpack(webpackConfig)