# time-egg **Repository Path**: daxiongnb/time-egg ## Basic Information - **Project Name**: time-egg - **Description**: 知语拾光-后端 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2024-11-24 - **Last Updated**: 2024-11-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 知语拾光-后端 - **技术栈:** Eggjs+MySQL - gitee:[前台](https://gitee.com/changzilin/time-web) [后台管理](https://gitee.com/changzilin/time-admin) - 😜 喜欢就点点 Star 吧! - 数据库文件:[蓝凑云](https://wwzk.lanzouo.com/i3pdL288c58j) ## 基础配置 1. 数据库配置 ```javascript // 位置:config/config.default.js // 用户名和密码改成自己数据库的 config.sequelize = { dialect: 'mysql', host: '127.0.0.1', username: 'root', password: '123456', port: 3306, database: 'zy_time', ... } ``` ```javascript // 位置:config/config.default.js // redis密码一般默认null config.redis = { port: 6379, // Redis port host: '127.0.0.1', // Redis host password: null, // 密码 db: 1 // 数据库 ... } ``` ```javascript // 位置:database/config.json // 用户名和密码改成自己数据库的 { "development": { "username": "root", "password": "123456", "database": "zy_time", "host": "127.0.0.1", "dialect": "mysql" }, ... } ``` 2. 创建数据库和数据表 ```sh npx sequelize db:create npx sequelize db:migrate ``` 3. 阿里云 OSS 配置 ```javascript // 位置:database/config.json // accessKeyId、accessKeySecret、bucket等信息改成自己的 config.oss = { client: { accessKeyId: 'LTAI5tQadFshKwdp9X9ckm3p', accessKeySecret: 'JRPc0PG6sC0g79JkiJ46nhFBOn14YD', bucket: 'time-egg', endpoint: 'oss-cn-guangzhou.aliyuncs.com', timeout: '60s' } } ``` ## 开发环境 ```sh npm install ``` ### 运行 ```sh npm run dev ``` ## 生产环境 ```sh npm install --production ``` ### 运行 ```sh npm run start ``` ### 停止 ```sh npm run stop ```