mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
18 lines
423 B
TypeScript
18 lines
423 B
TypeScript
|
|
import { DataSource } from "typeorm";
|
||
|
|
import { getConfig } from "../utils/config";
|
||
|
|
|
||
|
|
const config = getConfig();
|
||
|
|
|
||
|
|
const AppDataSource = new DataSource({
|
||
|
|
type: "postgres",
|
||
|
|
host: config.database.host,
|
||
|
|
port: config.database.port,
|
||
|
|
username: config.database.username,
|
||
|
|
password: config.database.password,
|
||
|
|
database: config.database.database,
|
||
|
|
synchronize: true,
|
||
|
|
entities: ["./entities/*.ts"],
|
||
|
|
});
|
||
|
|
|
||
|
|
export { AppDataSource };
|