curupiras
Version:
Curupiras é um template back-end que utiliza Express e TypeScript
23 lines (19 loc) • 415 B
text/typescript
import fs from 'fs';
import path from 'path';
import newKey from './generateKeyPair';
let publicKey: string;
let privateKey: string;
function readKeys() {
publicKey = fs.readFileSync(path.join(__dirname, '/public.pem'), 'utf-8')
privateKey = fs.readFileSync(path.join(__dirname, '/private.pem'), 'utf-8')
}
try {
readKeys()
} catch (error) {
newKey()
readKeys()
}
export {
publicKey,
privateKey
};