mirror of https://github.com/certd/certd
chore:
parent
330b84de33
commit
0227155ab4
|
@ -0,0 +1,8 @@
|
|||
|
||||
# 免费服务器部署
|
||||
|
||||
## 1. 注册koyeb账号
|
||||
|
||||
https://app.koyeb.com/
|
||||
|
||||
## 2. 创建应用
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue