加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.js 1.47 KB
一键复制 编辑 原始数据 按行查看 历史
夜愿 提交于 2022-08-20 10:45 . 半成品支付接口
const express = require('express')
const app = express()
const pay = require("./router/pay.js"); // 引入路由
//修改限制大小
const bodyParser = require('body-parser')
app.use(bodyParser.urlencoded({extended: false, limit: '10mb'}));
app.use(express.urlencoded({ extended: false }))
// 导入并配置cors中间件 --(为了解决浏览器的跨域问题)
const cors = require('cors')
app.use(cors())
// 引入路由文件
const userRouter = require('./router/user')
const dictionaryRouter = require('./router/dictionary')
const venueRouter = require('./router/venue')
const homeRouter = require('./router/home')
const appUserRouter = require('./router/app_user')
const carouselRouter = require('./router/carousel')
const opinionRouter = require('./router/opinion')
const noticeRouter = require('./router/notice')
const coachRouter = require('./router/coach')
const classRouter = require('./router/class')
app.use('/api/user', userRouter)
app.use('/api/dictionary', dictionaryRouter)
app.use('/api/venue', venueRouter)
app.use('/api/home', homeRouter)
app.use('/api/app_user', appUserRouter)
app.use('/api/carousel', carouselRouter)
app.use('/api/opinion', opinionRouter)
app.use('/api/notice', noticeRouter)
app.use('/api/coach', coachRouter)
app.use('/api/class', classRouter)
app.use(`/pay`, pay);
app.get('/getMovie', (req, res) => {
res.sendFile('public/back-1.mp4', { root: __dirname });
});
app.listen(9090, '0.0.0.0', function () {
console.log('服务器已启动!')
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化