feat(project): 配置项目别名和turbo工作流- 添加 @ 别名指向 src 目录

- 配置 turbo 工作流支持
- 更新 package.json 脚本和依赖
- 调整路由和组件导入路径
- 格式化模板代码和样式
- 新增模块配置文件和工作区设置
This commit is contained in:
2025-10-12 01:25:39 +08:00
parent 5d20a7def3
commit 6a412b3567
11 changed files with 49 additions and 15 deletions

27
module/server/index.js Normal file
View File

@@ -0,0 +1,27 @@
import Koa from 'koa';
import Router from 'koa-router';
import config from "./config/index.js"
const app = new Koa();
const router = new Router();
// 简单的路由示例
router.get('/', (ctx) => {
ctx.body = {message: 'Hello from Koa server!'};
});
router.get('/api/test', (ctx) => {
ctx.body = {message: 'This is a test API endpoint'};
});
router.get('/api/config', (ctx) => {
ctx.body = {data: config}
})
app.use(router.routes());
app.use(router.allowedMethods());
const PORT = process.env.PORT || 3001;
app.listen(PORT, () => {
console.log(`Koa server is running on port ${PORT}`);
});