token cache

This commit is contained in:
2025-02-26 23:59:42 +08:00
parent 26c6248d10
commit c01820d1c6
12 changed files with 433 additions and 44 deletions

View File

@@ -2,10 +2,13 @@ import { App } from '@kevisual/router';
import fs from 'fs';
import { getConfig, getPidList, pidFilePath, checkFileExists } from './module/get-config.ts';
import { sequelize } from './module/sequelize.ts';
import { spawn } from 'child_process';
export { sequelize };
export const app = new App();
export const app = new App({
serverOptions: {
httpType: 'https',
},
});
// 处理进程退出或中断信号,确保删除 pid 文件
const cleanUp = () => {
@@ -42,7 +45,7 @@ export const createApp = async () => {
}
fs.writeFileSync(pidFilePath, process.pid.toString());
app.listen(21015, () => {
console.log('Server is running on port 21015', 'http://localhost:21015/api/router', 'server id', process.pid);
console.log('Server is running on port 21015', 'https://localhost:21015/api/router', 'server id', process.pid);
});
// import('./route.ts');
};