fix: removed collage

fix: removing collage

feat: added ingredient type to server for testing and a config"

chore: setup deno server package
This commit is contained in:
Daniel Ledda
2022-06-20 22:22:42 +02:00
parent 47301a822d
commit c628f6b46e
18 changed files with 288 additions and 130 deletions

16
server/database.ts Normal file
View File

@@ -0,0 +1,16 @@
import { Client } from "https://deno.land/x/mysql/mod.ts";
import dbconfig from "./config.json" assert { type: "json" };
export type WithoutId<T> = Omit<T, "id">;
export interface StoccaTreDbConn {
query<T>(query: string): Promise<T>;
}
export default async function createNewDbConnection(): Promise<StoccaTreDbConn> {
return await new Client().connect({
hostname: dbconfig.hostname,
username: dbconfig.username,
db: "stocca_tre",
password: dbconfig.password,
});
}