From 16a1e5ca41859e4c6e28da87801046bb08be9641 Mon Sep 17 00:00:00 2001 From: pjmw9izve <2308014474@qq.com> Date: Sun, 6 Oct 2024 13:10:12 +0800 Subject: [PATCH] ADD file via upload --- app.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 app.js diff --git a/app.js b/app.js new file mode 100644 index 0000000..0d25f71 --- /dev/null +++ b/app.js @@ -0,0 +1,17 @@ +const express = require('express'); +const app = express(); +const router = require('./router'); +const bodyParser = require('body-parser'); + +// 中间件 +app.use(bodyParser.json()); +app.use(bodyParser.urlencoded({ extended: true })); + +// 使用路由 +app.use('/', router); + +// 监听端口 +const PORT = process.env.PORT || 3000; +app.listen(PORT, () => { + console.log(`Server running on port ${PORT}`); +});