This commit is contained in:
2023-08-05 16:03:31 +00:00
parent 92a67315f3
commit 743ab3e1aa
16 changed files with 138 additions and 49 deletions
+23 -4
View File
@@ -3,13 +3,15 @@ import 'reflect-metadata';
import { BasicQueryDTO } from './api/index.js';
import { validate } from 'class-validator';
import express, { type Request, type Response } from "express"
import { AppDataSource } from "./data_source"
import dotenv from "dotenv";
import { AppDataSource } from "./data_source.js"
import session from "express-session";
import path from 'node:path';
import { LiteHashDRBG } from './util/LiteHashDRBG.js';
import { simpleSerialize } from './util/simpleSerialize.js';
export async function test() {
console.log("Hello World!");
console.log(process.env.GAME_DB_HOST);
const dto = new BasicQueryDTO();
dto.command = 'None';
@@ -18,6 +20,23 @@ export async function test() {
const result = await validate(dto);
console.log(result);
//must be integer가 나타나야함
const rawRng = new LiteHashDRBG(simpleSerialize(
'haha',
'hoho'
));
const arr: Promise<Uint8Array>[] = [];
let j = 0;
for(let i = 0; i < 100; i += 1){
arr.push(rawRng.nextBits(32).then((v) => {
console.log(`${j}: ${i}`);
j += 1;
return v;
}));
}
await Promise.all(arr);
}
@@ -28,8 +47,8 @@ const ownConfig = {
port: Number(process.env.SERVER_PORT),
}
/*
AppDataSource.initialize().then(async () => {
// create express app
const app = express()
app.use(session({
@@ -47,5 +66,5 @@ AppDataSource.initialize().then(async () => {
console.log(`Express server has started on port ${ownConfig.port}`)
}).catch(error => console.log(error))
*/
export default {};