53 lines
1.3 KiB
TypeScript
53 lines
1.3 KiB
TypeScript
import 'dotenv/config';
|
|
import 'reflect-metadata';
|
|
import { validate } from 'class-validator';
|
|
import express, { type Request, type Response } from "express"
|
|
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';
|
|
import { SammoRootAPI } from './clientAPI/sammoRootAPI.js';
|
|
|
|
export async function test() {
|
|
console.log("Hello World!");
|
|
console.log(process.env.GAME_DB_HOST);
|
|
|
|
const abc= {
|
|
a: 1,
|
|
b: 2,
|
|
c: 3,
|
|
}
|
|
const t2 = await validate(abc);
|
|
console.log(t2);
|
|
}
|
|
|
|
|
|
await test();
|
|
|
|
const ownConfig = {
|
|
sessionSecret: process.env.SESSION_SECRET,
|
|
port: Number(process.env.SERVER_PORT),
|
|
}
|
|
|
|
/*
|
|
AppDataSource.initialize().then(async () => {
|
|
// create express app
|
|
const app = express()
|
|
app.use(session({
|
|
secret: ownConfig.sessionSecret,
|
|
resave: false,
|
|
saveUninitialized: false,
|
|
}))
|
|
app.set('etag', false);
|
|
|
|
//app.use('/', rootRouter);
|
|
|
|
// start express server
|
|
app.listen(ownConfig.port)
|
|
|
|
console.log(`Express server has started on port ${ownConfig.port}`)
|
|
|
|
}).catch(error => console.log(error))
|
|
*/
|
|
export default {}; |