feat: 初始化项目结构并添加基本功能
- 新增 .env 文件,配置服务器端口 - 添加 nodemon 作为开发依赖 - 创建服务器入口文件,设置基本路由 - 移除旧的服务器代码 - 更新 package.json,添加启动脚本
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
const express = require('express');
|
||||
const roleRoutes = require('./routes/role.routes');
|
||||
|
||||
const app = express();
|
||||
const port = 3000;
|
||||
|
||||
// 注册路由
|
||||
app.use('/api', roleRoutes);
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server is running on http://localhost:${port}`);
|
||||
});
|
||||
Reference in New Issue
Block a user