tambahan
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user