pull/148/head
xiaojunnuo 2024-08-04 22:46:08 +08:00
parent 330b84de33
commit 0227155ab4
2 changed files with 15 additions and 0 deletions

8
doc/server/free.md Normal file
View File

@ -0,0 +1,8 @@
# 免费服务器部署
## 1. 注册koyeb账号
https://app.koyeb.com/
## 2. 创建应用

View File

@ -2,6 +2,7 @@ import fs from 'fs';
import yaml from 'js-yaml';
import * as _ from 'lodash-es';
import { nanoid } from 'nanoid';
import path from 'path';
const KEYS_FILE = './data/keys.yaml';
export class Keys {
jwtKey: string = nanoid();
@ -19,6 +20,12 @@ export class Keys {
}
save() {
const parent = path.dirname(KEYS_FILE);
if (!fs.existsSync(parent)) {
fs.mkdirSync(parent, {
recursive: true,
});
}
fs.writeFileSync(KEYS_FILE, yaml.dump(this));
}
}