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

View File

@@ -0,0 +1,3 @@
export default {
}

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}`);
});

View File

@@ -0,0 +1,15 @@
{
"name": "chuanqi-server",
"version": "1.0.0",
"description": "A simple Koa server for chuanqi web",
"main": "index.js",
"type": "module",
"scripts": {
"start": "node index.js",
"dev": "node index.js"
},
"dependencies": {
"koa": "^2.15.0",
"koa-router": "^12.0.0"
}
}

View File

@@ -0,0 +1,8 @@
{
"name": "web-link",
"private": true,
"scripts": {
"dev": "cd ../.. && pnpm dev",
"build": "cd ../.. && pnpm build"
}
}