This commit is contained in:
bipproduction
2025-11-23 17:35:59 +08:00
parent 73c281d2b1
commit 51c9c4f126
19 changed files with 1168 additions and 766 deletions

View File

@@ -1,27 +1,26 @@
import Elysia, { t } from "elysia";
import Swagger from "@elysiajs/swagger";
import html from "./index.html"
import html from "./index.html";
import Dashboard from "./server/routes/darmasaba";
import { apiAuth } from "./server/middlewares/apiAuth";
import Auth from "./server/routes/auth_route";
import ApiKeyRoute from "./server/routes/apikey_route";
import type { User } from "generated/prisma";
const Docs = new Elysia()
.use(Swagger({
const Docs = new Elysia().use(
Swagger({
path: "/docs",
}))
}),
);
const ApiUser = new Elysia({
prefix: "/user",
})
.get('/find', (ctx) => {
const { user } = ctx as any
return {
user: user as User
}
})
}).get("/find", (ctx) => {
const { user } = ctx as any;
return {
user: user as User,
};
});
const Api = new Elysia({
prefix: "/api",
@@ -29,7 +28,7 @@ const Api = new Elysia({
.use(apiAuth)
.use(ApiKeyRoute)
.use(Dashboard)
.use(ApiUser)
.use(ApiUser);
const app = new Elysia()
.use(Api)
@@ -40,6 +39,4 @@ const app = new Elysia()
console.log("Server running at http://localhost:3000");
});
export type ServerApp = typeof app;