diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..cbdf5bb5ff5610a6c4367020b7c66636447dd6ef --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,18 @@ +{ + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript" + ], + "editor.tabSize": 2, + "editor.codeActionsOnSave": { + "source.fixAll": true, + "source.fixAll.eslint": true, + // "source.organizeImports": true + }, + "editor.quickSuggestions": { + "other": "on", + "comments": true, + "strings": true + }, +} \ No newline at end of file diff --git a/README.md b/README.md index eb0294c06d73894242e7d2d6d5662380934cbbbb..a7aa8289d67709f8b0ba844dee953ffa9f4f1641 100644 --- a/README.md +++ b/README.md @@ -1,119 +1,120 @@ -# GiiBee CMS - -> The CMS system developed by nest.js based on node.js and nuxt.js based on vue.js is used to implement SSR server-side rendering and generate static HTML, which is conducive to SEO.Suitable for enterprises to build SEO-type websites. - - -English | [简体中文](./README.zh-CN.md) - - -## Getting started - -### MySql - -1. Create the `nest_cms_api` table; - -2. Use MySql command or management software to import the `.sql` file in the `DB` directory. - -### CMS API server - -```bash -cd server - -npm install - -# development -$ npm run start - -# watch mode -$ npm run start:dev - -# production mode -$ npm run start:prod -``` - -* Serve: [http://localhost:3000/](http://localhost:3000/) -* API documentation: [http://localhost:3000/api/](http://localhost:3000/api/) - -### CMS management - -```bash -cd admin - -npm install - -# serve with hot reload at localhost:3002 -npm run dev - -# build for production and launch server - -npm run build:stage - -npm run build:prod -``` - -* Serve: [http://localhost:3002/](http://localhost:3002/) - - -### CMS web - -```bash -cd web - -npm install - -# development -$ npm run dev - -# build for production and launch server -$ npm run build -$ npm run start - -# generate static project -$ npm run generate -``` - -* Serve: [http://localhost:3001/](http://localhost:3001/) - - -## Features - -* NestJS + MySql output API. -* API calls sensitive operation records IP, administrator and client information. -* NuxtJS + Vue + Bootstrap-vue can generate static HTML for the whole site (SEO). -* Nuxtjs vue implements SSR server-side rendering (SEO). -* Element UI + Vue realizes CMS management. -* Front-end and back-end separation. -* JWT authentication. -* Commodity classification supports custom routing and web page description (SEO). -* Product name supports custom routing and web page description (SEO). -* Responsive web pages, adapted to PC and mobile terminals. - -## screenshot - -### CMS web -![home](screenshot/web/mobile-home.png) - -![home](screenshot/web/home.jpg) - -![product](screenshot/web/mobile-product.png) - -![product](screenshot/web/product.jpg) - -![about](screenshot/web/mobile-about.png) -![about](screenshot/web/about.jpg) - -### CMS management - -![banner](screenshot/admin/banner.png) - -![product](screenshot/admin/product-create.png) - -![product](screenshot/admin/product.png) - -### CMS API - -![API](screenshot/server/api.jpg) - -## License - -[Apache License 2.0](LICENSE). +# GiiBee CMS + +> The CMS system developed by nest.js based on node.js and nuxt.js based on vue.js is used to implement SSR server-side rendering and generate static HTML, which is conducive to SEO.Suitable for enterprises to build SEO-type websites. + + +English | [简体中文](./README.zh-CN.md) + + +## Getting started + +### MySql + +1. Create the `nest_cms_api` table; + +2. Use MySql command or management software to import the `.sql` file in the `DB` directory. + +### CMS API server + +```bash +cd server + +npm install + +# development +$ npm run start + +# watch mode +$ npm run start:dev + +# production mode +$ npm run start:prod +``` + +* Serve: [http://localhost:3000/](http://localhost:3000/) +* API documentation: [http://localhost:3000/api/](http://localhost:3000/api/) +* Configuration: [config.default.ts](server/config/config.default.ts) + +### CMS management + +```bash +cd admin + +npm install + +# serve with hot reload at localhost:3002 +npm run dev + +# build for production and launch server + +npm run build:stage + +npm run build:prod +``` + +* Serve: [http://localhost:3002/](http://localhost:3002/) + + +### CMS web + +```bash +cd web + +npm install + +# development +$ npm run dev + +# build for production and launch server +$ npm run build +$ npm run start + +# generate static project +$ npm run generate +``` + +* Serve: [http://localhost:3001/](http://localhost:3001/) + + +## Features + +* NestJS + MySql output API. +* API calls sensitive operation records IP, administrator and client information. +* NuxtJS + Vue + Bootstrap-vue can generate static HTML for the whole site (SEO). +* Nuxtjs vue implements SSR server-side rendering (SEO). +* Element UI + Vue realizes CMS management. +* Front-end and back-end separation. +* JWT authentication. +* Commodity classification supports custom routing and web page description (SEO). +* Product name supports custom routing and web page description (SEO). +* Responsive web pages, adapted to PC and mobile terminals. + +## screenshot + +### CMS web +![home](screenshot/web/mobile-home.png) + +![home](screenshot/web/home.jpg) + +![product](screenshot/web/mobile-product.png) + +![product](screenshot/web/product.jpg) + +![about](screenshot/web/mobile-about.png) +![about](screenshot/web/about.jpg) + +### CMS management + +![banner](screenshot/admin/banner.png) + +![product](screenshot/admin/product-create.png) + +![product](screenshot/admin/product.png) + +### CMS API + +![API](screenshot/server/api.jpg) + +## License + +[Apache License 2.0](LICENSE). diff --git a/README.zh-CN.md b/README.zh-CN.md index 8b733e4d3c4ba90f24e32bc479c3ca4744f75c49..7f0373b83610446147375fd3b2c824fd65c4b9ee 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -1,118 +1,119 @@ -# GiiBee CMS - -> 使用 nest.js 基于 node.js 和 nuxt.js 基于 vue.js 开发的 CMS 系统,实现 SSR 服务端渲染,且可生成静态HTML,有利于SEO。适合企业搭建SEO型网站。 - -[English](./README.md) | 简体中文] - - -## 开始使用 - -### MySql - -1. 创建 `nest_cms_api` 表; - -2. 使用 MySql 命令或者管理软件导入 `DB` 目录下的 `.sql` 文件。 - -### CMS API - -```bash -cd server - -npm install - -# 开发 -$ npm run start - -# 开发监听模式 -$ npm run start:dev - -# 生产模式 -$ npm run start:prod -``` - -* 查看: [http://localhost:3000/](http://localhost:3000/) -* API 文档: [http://localhost:3000/api/](http://localhost:3000/api/) - -### CMS 管理系统 - -```bash -cd admin - -npm install - -# 开发模式 -npm run dev - -# 构建 - -npm run build:stage - -npm run build:prod -``` - -* 查看: [http://localhost:3002/](http://localhost:3002/) - - -### CMS web - -```bash -cd web - -npm install - -# 开发模式 -$ npm run dev - -# 构建生产环境并启动服务 -$ npm run build -$ npm run start - -# 生成静态项目 -$ npm run generate -``` - -* 查看: [http://localhost:3001/](http://localhost:3001/) - - -## 特色 - -* NestJS + MySql 输出 API。 -* API 调用敏感操作记录 IP、管理员及客户端信息。 -* Nuxtjs 实现 Vue SSR 服务端渲染 (SEO)。 -* NuxtJS + Vue + Bootstrap-vue 实现整站生成 HTML 静态网站 (SEO)。 -* Element UI + Vue 实现 CMS 系统管理。 -* 前后端分离开发。 -* JWT 身份认证。 -* 商品分类支持自定义路由和网页描述 (SEO)。 -* 产品名称支持自定义路由和网页描述 (SEO)。 -* 响应式网页,适配 PC 端和移动端。 - -## 截图 - -### CMS web -![home](screenshot/web/mobile-home.png) - -![home](screenshot/web/home.jpg) - -![product](screenshot/web/mobile-product.png) - -![product](screenshot/web/product.jpg) - -![about](screenshot/web/mobile-about.png) -![about](screenshot/web/about.jpg) - -### CMS 管理 - -![banner](screenshot/admin/banner.png) - -![product](screenshot/admin/product-create.png) - -![product](screenshot/admin/product.png) - -### CMS API - -![API](screenshot/server/api.jpg) - -## License - -[Apache License 2.0](LICENSE). +# GiiBee CMS + +> 使用 nest.js 基于 node.js 和 nuxt.js 基于 vue.js 开发的 CMS 系统,实现 SSR 服务端渲染,且可生成静态HTML,有利于SEO。适合企业搭建SEO型网站。 + +[English](./README.md) | 简体中文] + + +## 开始使用 + +### MySql + +1. 创建 `nest_cms_api` 表; + +2. 使用 MySql 命令或者管理软件导入 `DB` 目录下的 `.sql` 文件。 + +### CMS API + +```bash +cd server + +npm install + +# 开发 +$ npm run start + +# 开发监听模式 +$ npm run start:dev + +# 生产模式 +$ npm run start:prod +``` + +* 查看: [http://localhost:3000/](http://localhost:3000/) +* API 文档: [http://localhost:3000/api/](http://localhost:3000/api/) +* 项目配置: [config.default.ts](server/config/config.default.ts) + +### CMS 管理系统 + +```bash +cd admin + +npm install + +# 开发模式 +npm run dev + +# 构建 + +npm run build:stage + +npm run build:prod +``` + +* 查看: [http://localhost:3002/](http://localhost:3002/) + + +### CMS web + +```bash +cd web + +npm install + +# 开发模式 +$ npm run dev + +# 构建生产环境并启动服务 +$ npm run build +$ npm run start + +# 生成静态项目 +$ npm run generate +``` + +* 查看: [http://localhost:3001/](http://localhost:3001/) + + +## 特色 + +* NestJS + MySql 输出 API。 +* API 调用敏感操作记录 IP、管理员及客户端信息。 +* Nuxtjs 实现 Vue SSR 服务端渲染 (SEO)。 +* NuxtJS + Vue + Bootstrap-vue 实现整站生成 HTML 静态网站 (SEO)。 +* Element UI + Vue 实现 CMS 系统管理。 +* 前后端分离开发。 +* JWT 身份认证。 +* 商品分类支持自定义路由和网页描述 (SEO)。 +* 产品名称支持自定义路由和网页描述 (SEO)。 +* 响应式网页,适配 PC 端和移动端。 + +## 截图 + +### CMS web +![home](screenshot/web/mobile-home.png) + +![home](screenshot/web/home.jpg) + +![product](screenshot/web/mobile-product.png) + +![product](screenshot/web/product.jpg) + +![about](screenshot/web/mobile-about.png) +![about](screenshot/web/about.jpg) + +### CMS 管理 + +![banner](screenshot/admin/banner.png) + +![product](screenshot/admin/product-create.png) + +![product](screenshot/admin/product.png) + +### CMS API + +![API](screenshot/server/api.jpg) + +## License + +[Apache License 2.0](LICENSE). diff --git a/server/config/config.default.ts b/server/config/config.default.ts new file mode 100644 index 0000000000000000000000000000000000000000..bc39cd8872ef7ff983bfbe012527781785af38b3 --- /dev/null +++ b/server/config/config.default.ts @@ -0,0 +1,27 @@ +import configLocal from './config.local'; +import configProd from './config.prod'; +import configUnittest from './config.unittest'; + +// 默认配置 - 会自动合并运行环境配置。 +export default () => + Object.assign( + // 默认配置 + { + // 项目启动端口 + port: 3000, + // 数据库配置 + mysql: { + host: 'localhost', + port: 3306, + username: 'username', + password: 'password', + database: 'database', + synchronize: true, + }, + }, + { + local: configLocal, + pord: configProd, + unittest: configUnittest, + }[process.env.FM_SERVER_ENV](), + ); diff --git a/server/config/config.local.ts b/server/config/config.local.ts new file mode 100644 index 0000000000000000000000000000000000000000..8a6ea1bcaf095a29d388376c6a1063b30eef8658 --- /dev/null +++ b/server/config/config.local.ts @@ -0,0 +1,11 @@ +// 开发环境配置 +export default () => ({ + mysql: { + host: 'localhost', + port: 3306, + username: 'nest_cms_api', + password: 'nest_cms_api', + database: 'nest_cms_api', + synchronize: true, + }, +}); diff --git a/server/config/config.prod.ts b/server/config/config.prod.ts new file mode 100644 index 0000000000000000000000000000000000000000..29150c19f3057f7b27ae72191824a62060ccf0f9 --- /dev/null +++ b/server/config/config.prod.ts @@ -0,0 +1,11 @@ +// 生产环境配置 +export default () => ({ + mysql: { + host: '10.0.224.4', + port: 25532 || 3306, + username: 'root', + password: '', + database: 'nest_cms_api', + synchronize: true, + }, +}); diff --git a/server/config/config.unittest.ts b/server/config/config.unittest.ts new file mode 100644 index 0000000000000000000000000000000000000000..289717da161c8f4276dd2f256a0c1da7c5e929c7 --- /dev/null +++ b/server/config/config.unittest.ts @@ -0,0 +1,3 @@ +export default () => ({ + // 测试环境配置 +}); diff --git a/server/package-lock.json b/server/package-lock.json index 04a48483c09a7d9de275a325bebcd26302b0e7e9..e6a9878b1c70565e5882c1a7b082d9f66dfb4a8f 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -10,6 +10,7 @@ "license": "UNLICENSED", "dependencies": { "@nestjs/common": "^8.0.0", + "@nestjs/config": "^2.2.0", "@nestjs/core": "^8.0.0", "@nestjs/jwt": "^8.0.0", "@nestjs/passport": "^8.0.1", @@ -45,6 +46,7 @@ "@types/supertest": "^2.0.11", "@typescript-eslint/eslint-plugin": "^4.28.2", "@typescript-eslint/parser": "^4.28.2", + "cross-env": "^7.0.3", "eslint": "^7.30.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-prettier": "^3.4.0", @@ -2227,6 +2229,30 @@ } } }, + "node_modules/@nestjs/config": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/@nestjs/config/-/config-2.2.0.tgz", + "integrity": "sha512-78Eg6oMbCy3D/YvqeiGBTOWei1Jwi3f2pSIZcZ1QxY67kYsJzTRTkwRT8Iv30DbK0sGKc1mcloDLD5UXgZAZtg==", + "dependencies": { + "dotenv": "16.0.1", + "dotenv-expand": "8.0.3", + "lodash": "4.17.21", + "uuid": "8.3.2" + }, + "peerDependencies": { + "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0", + "reflect-metadata": "^0.1.13", + "rxjs": "^6.0.0 || ^7.2.0" + } + }, + "node_modules/@nestjs/config/node_modules/dotenv": { + "version": "16.0.1", + "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-16.0.1.tgz", + "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==", + "engines": { + "node": ">=12" + } + }, "node_modules/@nestjs/core": { "version": "8.1.0", "resolved": "https://registry.npmmirror.com/@nestjs/core/download/@nestjs/core-8.1.0.tgz", @@ -4547,6 +4573,24 @@ "integrity": "sha1-wdfo8eX2z8n/ZfnNNS03NIdWwzM=", "dev": true }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmmirror.com/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.3.tgz", @@ -4791,6 +4835,14 @@ "node": ">=10" } }, + "node_modules/dotenv-expand": { + "version": "8.0.3", + "resolved": "https://registry.npmmirror.com/dotenv-expand/-/dotenv-expand-8.0.3.tgz", + "integrity": "sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg==", + "engines": { + "node": ">=12" + } + }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.nlark.com/ecdsa-sig-formatter/download/ecdsa-sig-formatter-1.0.11.tgz", @@ -13930,6 +13982,24 @@ "uuid": "8.3.2" } }, + "@nestjs/config": { + "version": "2.2.0", + "resolved": "https://registry.npmmirror.com/@nestjs/config/-/config-2.2.0.tgz", + "integrity": "sha512-78Eg6oMbCy3D/YvqeiGBTOWei1Jwi3f2pSIZcZ1QxY67kYsJzTRTkwRT8Iv30DbK0sGKc1mcloDLD5UXgZAZtg==", + "requires": { + "dotenv": "16.0.1", + "dotenv-expand": "8.0.3", + "lodash": "4.17.21", + "uuid": "8.3.2" + }, + "dependencies": { + "dotenv": { + "version": "16.0.1", + "resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-16.0.1.tgz", + "integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==" + } + } + }, "@nestjs/core": { "version": "8.1.0", "resolved": "https://registry.npmmirror.com/@nestjs/core/download/@nestjs/core-8.1.0.tgz", @@ -15770,6 +15840,15 @@ "integrity": "sha1-wdfo8eX2z8n/ZfnNNS03NIdWwzM=", "dev": true }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmmirror.com/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.3.tgz", @@ -15959,6 +16038,11 @@ "resolved": "https://registry.nlark.com/dotenv/download/dotenv-8.6.0.tgz?cache=0&sync_timestamp=1621633079842&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fdotenv%2Fdownload%2Fdotenv-8.6.0.tgz", "integrity": "sha1-Bhr2ZNGff02PxuT/m1hM4jety4s=" }, + "dotenv-expand": { + "version": "8.0.3", + "resolved": "https://registry.npmmirror.com/dotenv-expand/-/dotenv-expand-8.0.3.tgz", + "integrity": "sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg==" + }, "ecdsa-sig-formatter": { "version": "1.0.11", "resolved": "https://registry.nlark.com/ecdsa-sig-formatter/download/ecdsa-sig-formatter-1.0.11.tgz", diff --git a/server/package.json b/server/package.json index 3abec7e067997c87c96871d1d17b8f0771ac3914..9e769146d65380f18208249149eb8aefc6bb3f88 100644 --- a/server/package.json +++ b/server/package.json @@ -9,20 +9,21 @@ "prebuild": "rimraf dist", "build": "nest build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", - "start": "nest start", - "start:dev": "nest start --watch", - "start:debug": "nest start --debug --watch", - "start:prod": "node dist/main", - "start:pm2": "node dist/main", + "start": "cross-env FM_SERVER_ENV=local nest start", + "start:dev": "cross-env FM_SERVER_ENV=local nest start --watch", + "start:debug": "cross-env FM_SERVER_ENV=local nest start --debug --watch", + "start:prod": "cross-env FM_SERVER_ENV=prod node dist/main", + "start:pm2": "cross-env FM_SERVER_ENV=prod node dist/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", - "test": "jest", - "test:watch": "jest --watch", - "test:cov": "jest --coverage", - "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", - "test:e2e": "jest --config ./test/jest-e2e.json" + "test": "cross-env FM_SERVER_ENV=unittest jest", + "test:watch": "cross-env FM_SERVER_ENV=unittest jest --watch", + "test:cov": "cross-env FM_SERVER_ENV=unittest jest --coverage", + "test:debug": "cross-env FM_SERVER_ENV=unittest node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", + "test:e2e": "cross-env FM_SERVER_ENV=unittest jest --config ./test/jest-e2e.json" }, "dependencies": { "@nestjs/common": "^8.0.0", + "@nestjs/config": "^2.2.0", "@nestjs/core": "^8.0.0", "@nestjs/jwt": "^8.0.0", "@nestjs/passport": "^8.0.1", @@ -31,6 +32,7 @@ "@nestjs/swagger": "^5.1.0", "@nestjs/typeorm": "^8.0.2", "class-validator": "^0.13.1", + "cross-env": "^7.0.3", "crypto-js": "^4.1.1", "generate-password": "^1.6.1", "jimp": "^0.16.1", diff --git a/server/src/app.module.ts b/server/src/app.module.ts index 31c46ed7932a001c7ada6f699461d138d73e2d96..b6f850001d04faf665ffb1ecc61a86e70ad8825e 100644 --- a/server/src/app.module.ts +++ b/server/src/app.module.ts @@ -13,35 +13,38 @@ import { AuthModule } from './auth/auth.module'; import { ServeStaticModule } from '@nestjs/serve-static'; import { join } from 'path'; import { Log4jsModule } from './libs/log4js/'; - -const ENV = process.env.NODE_ENV; -const dbInfo = { - host: 'localhost', - port: 3306, - username: 'root', - password: '123456789', -}; -if (ENV === 'prod') { - dbInfo.host = '10.0.224.4'; - dbInfo.port = 25532 || 3306; - dbInfo.username = 'root'; - dbInfo.password = ''; -} -const { host, port, username, password } = dbInfo; +import { ConfigModule, ConfigService } from '@nestjs/config'; +import configDefault from '../config/config.default'; @Module({ imports: [ - TypeOrmModule.forRoot({ - type: 'mysql', - host, - port, - username, - password, - database: 'nest_cms_api', - entities: [], - autoLoadEntities: true, - synchronize: false, + // 配置模块 + ConfigModule.forRoot({ + load: [configDefault], + }), + // TypeOrm模块 + TypeOrmModule.forRootAsync({ + imports: [ConfigModule], + inject: [ConfigService], + useFactory: (configService: ConfigService) => ({ + type: 'mysql', + host: configService.get('mysql.host'), + port: +configService.get('mysql.pord'), + username: configService.get('mysql.username'), + password: configService.get('mysql.password'), + database: configService.get('mysql.database'), + synchronize: configService.get('mysql.synchronize'), + autoLoadEntities: true, + keepConnectionAlive: true, + }), + }), + // 静态资源模块 + ServeStaticModule.forRoot({ + rootPath: join(__dirname, '..', 'public'), }), + // 日志模块 + Log4jsModule.forRoot(), + // 业务模块... UsersModule, ProductsModule, ProductCategoriesModule, @@ -50,10 +53,6 @@ const { host, port, username, password } = dbInfo; BannerModule, UploadModule, AuthModule, - ServeStaticModule.forRoot({ - rootPath: join(__dirname, '..', 'public'), - }), - Log4jsModule.forRoot(), ], controllers: [AppController], providers: [AppService], diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1 @@ +{} \ No newline at end of file