2 Star 48 Fork 75

汐屿 / Afly-OrderMeals-h5

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
prod.server.js 777 Bytes
一键复制 编辑 原始数据 按行查看 历史
ustbhuangyi 提交于 2018-11-03 10:26 . finish all the feature
const express = require('express')
const app = express()
const appData = require('./data.json')
const seller = appData.seller
const goods = appData.goods
const ratings = appData.ratings
const router = express.Router()
router.get('/seller', function (req, res) {
res.json({
errno: 0,
data: seller
})
})
router.get('/goods', function (req, res) {
res.json({
errno: 0,
data: goods
})
})
router.get('/ratings', function (req, res) {
res.json({
errno: 0,
data: ratings
})
})
app.use('/api', router)
app.use(express.static('./dist'))
const port = process.env.PORT || 8900
module.exports = app.listen(port, function (err) {
if (err) {
console.log(err)
return
}
console.log('Listening at http://localhost:' + port + '\n')
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ah-f/Afly-OrderMeals-h5.git
git@gitee.com:ah-f/Afly-OrderMeals-h5.git
ah-f
Afly-OrderMeals-h5
Afly-OrderMeals-h5
next

搜索帮助

344bd9b3 5694891 D2dac590 5694891