代码拉取完成,页面将自动刷新
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('服务器已启动!')
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。