running now

This commit is contained in:
Anika Raemer 2025-09-22 20:17:46 +02:00
parent 85cd083750
commit c17bb05f0a
25 changed files with 156 additions and 114 deletions

View file

@ -2,7 +2,13 @@ import "reflect-metadata";
import { DataSource } from "typeorm";
import * as dotenv from "dotenv";
import { UserEntity } from "./entities/UserEntity";
import { UserEntity } from "./entities/UserEntity.js";
import { fileURLToPath } from "url";
import { dirname, join } from "path";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
dotenv.config();
@ -20,7 +26,7 @@ export const AppDataSource = new DataSource({
synchronize: NODE_ENV === "dev" ? false : false,
//logging logs sql command on the terminal
logging: NODE_ENV === "dev" ? false : false,
entities: [UserEntity],
migrations: [__dirname + "/migration/*.ts"],
entities: [join(__dirname, "/entities/*.{ts,js}")],
migrations: [join(__dirname, "/migrations/*.{ts,js}")],
subscribers: [],
});