mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
Add media upload functionality and create uploads
folder
This commit is contained in:
parent
ca94c35bc4
commit
8fa16d4e09
7 changed files with 318 additions and 16 deletions
|
|
@ -1,22 +1,10 @@
|
|||
import { DataSource } from "typeorm";
|
||||
import { getConfig } from "../utils/config";
|
||||
import { PrismaClient } from "@prisma/client";
|
||||
|
||||
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: [process.cwd() + "/database/entities/*.ts"],
|
||||
});
|
||||
|
||||
const client = new PrismaClient({
|
||||
datasourceUrl: `postgresql://${config.database.username}:${config.database.password}@${config.database.host}:${config.database.port}/${config.database.database}`,
|
||||
});
|
||||
|
||||
export { AppDataSource, client };
|
||||
export { client };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue