no typeorm,

This commit is contained in:
2023-08-18 15:35:22 +00:00
parent a37baa64fe
commit 60848987eb
4 changed files with 44 additions and 304 deletions
-14
View File
@@ -1,14 +0,0 @@
import "dotenv/config";
import { DataSource } from "typeorm";
export const AppDataSource = new DataSource({
type: "mariadb",
host: process.env.GAME_DB_HOST,
port: Number(process.env.GAME_DB_PORT),
username: process.env.GAME_DB_USER,
password: process.env.GAME_DB_PASSWORD,
charset: "utf8mb4",
entities: [],
migrations: [],
subscribers: [],
})
+3 -4
View File
@@ -1,7 +1,6 @@
import 'dotenv/config';
import 'reflect-metadata';
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';
@@ -14,10 +13,10 @@ import { unwrap } from './util/unwrap.js';
const ownConfig = {
sessionSecret: process.env.SESSION_SECRET,
port: Number(process.env.SERVER_PORT),
}
};
AppDataSource.initialize().then(async () => {
(async () => {
// create express app
const app = express()
app.use(express.json());
@@ -35,6 +34,6 @@ AppDataSource.initialize().then(async () => {
console.log(`Express server has started on port ${ownConfig.port}`)
}).catch(error => console.log(error))
})().catch(error => console.log(error));
export default {};