Compare commits

...

4 Commits

Author SHA1 Message Date
aad87d4d7e 细节修复 2025-08-26 20:23:10 +08:00
7c2ed2f1de 换端口 2025-08-26 17:58:36 +08:00
ecd63053ba 细节问题 2025-08-26 17:55:24 +08:00
Jerry
8c82079fc7
Create LICENSE 2025-08-26 16:56:51 +08:00
7 changed files with 31 additions and 19 deletions

View File

@ -1,7 +1,4 @@
PORT=4000
DEBUG=true
RD_PORT=6379 RD_PORT=6379
RD_ADD=127.0.0.1 RD_ADD=127.0.0.1
WS_SECRET=114514 WS_SECRET=114514
WS_PORT=4001
TOKEN=54188 TOKEN=54188

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 Crystelf
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,8 +1,8 @@
{ {
"name": "nest-backend", "name": "crystelf-core",
"version": "0.0.1", "version": "1.0.0",
"description": "", "description": "crystelf - working together for a bright future",
"author": "", "author": "Jerryplusy",
"private": true, "private": true,
"license": "UNLICENSED", "license": "UNLICENSED",
"scripts": { "scripts": {

View File

@ -32,13 +32,7 @@ export class AppConfigService implements OnModuleInit {
private checkRequiredVariables(): void { private checkRequiredVariables(): void {
this.logger.log('检查必要环境变量..'); this.logger.log('检查必要环境变量..');
const requiredVariables = [ const requiredVariables = ['RD_PORT', 'RD_ADD', 'WS_SECRET'];
'PORT',
'RD_PORT',
'RD_ADD',
'WS_SECRET',
'WS_PORT',
];
requiredVariables.forEach((key) => { requiredVariables.forEach((key) => {
const value = this.nestConfigService.get(key); const value = this.nestConfigService.get(key);

View File

@ -27,7 +27,7 @@ export class PathService {
userData: path.join(this.baseDir, 'private/data'), userData: path.join(this.baseDir, 'private/data'),
package: path.join(this.baseDir, 'package.json'), package: path.join(this.baseDir, 'package.json'),
modules: path.join(this.baseDir, 'src/modules'), modules: path.join(this.baseDir, 'src/modules'),
words: path.join(this.baseDir, 'private/word'), words: path.join(this.baseDir, 'private/words/src'),
}; };
return type ? mappings[type] : this.baseDir; return type ? mappings[type] : this.baseDir;

View File

@ -16,7 +16,7 @@ import {
import { AppConfigService } from '../../config/config.service'; import { AppConfigService } from '../../config/config.service';
import { WsMessageHandler } from './ws-message.handler'; import { WsMessageHandler } from './ws-message.handler';
@WebSocketGateway(7001, { @WebSocketGateway({
cors: { origin: '*' }, cors: { origin: '*' },
driver: 'ws', driver: 'ws',
}) })

View File

@ -33,12 +33,12 @@ async function bootstrap() {
const document = () => SwaggerModule.createDocument(app, config); const document = () => SwaggerModule.createDocument(app, config);
SwaggerModule.setup('docs', app, document); SwaggerModule.setup('docs', app, document);
app.useWebSocketAdapter(new WsAdapter(app)); app.useWebSocketAdapter(new WsAdapter(app));
await app.listen(7000); await app.listen(6868);
await systemService.checkUpdate().catch((err) => { await systemService.checkUpdate().catch((err) => {
Logger.error(`自动更新失败: ${err?.message}`, '', 'System'); Logger.error(`自动更新失败: ${err?.message}`, '', 'System');
}); });
} }
bootstrap().then(() => { bootstrap().then(() => {
Logger.log(`API服务已启动http://localhost:7000/api`); Logger.log(`API服务已启动http://localhost:6868/api`);
Logger.log(`API文档 http://localhost:7000/docs`); Logger.log(`API文档 http://localhost:6868/docs`);
}); });