Skip to content

Commit

Permalink
add: cors
Browse files Browse the repository at this point in the history
  • Loading branch information
Celesca committed Nov 20, 2024
1 parent 095f77d commit 5c01181
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"prepare": "husky"
},
"dependencies": {
"@elysiajs/cors": "^1.1.1",
"@elysiajs/swagger": "^1.1.5",
"@prisma/client": "^5.22.0",
"elysia": "^1.1.24"
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Elysia } from "elysia";
import { cors } from "@elysiajs/cors";
import { swagger } from "@elysiajs/swagger";
import { swipeController } from "./controllers/swipeController";
import { userController } from "./controllers/userController";
Expand All @@ -11,6 +12,9 @@ import { teamController } from "./controllers/teamController";
const app = new Elysia()
.get("/", () => "Hello Elysia")
.use(swagger())
.use(cors({
origin: "*",
}))
.use(swipeController)
.use(notificationController)
.use(userController)
Expand Down

0 comments on commit 5c01181

Please sign in to comment.