Add swagger, update TypeScript

This commit is contained in:
2024-12-05 00:45:37 +01:00
parent d75ecf61b6
commit 80c574dfd6
4 changed files with 87 additions and 20 deletions

View File

@@ -9,6 +9,7 @@
},
"dependencies": {
"@elysiajs/cors": "catalog:",
"@elysiajs/swagger": "catalog:",
"common": "workspace:^",
"elysia": "catalog:",
"kysely": "catalog:",

View File

@@ -1,4 +1,5 @@
import cors from "@elysiajs/cors";
import { swagger } from "@elysiajs/swagger";
import { AttachmentId, PieceId, RequestId, SessionId, Sha256 } from "common";
import * as Function from "common/Function";
import { Elysia, error, form, t } from "elysia";
@@ -11,6 +12,8 @@ const tbranded = <T>() => t.Transform(t.String())
const app = new Elysia()
.use(swagger())
.use(cors({ origin: "localhost:5173" }))
.decorate("db", await initDatabase())