Added cors to backend

pull/3/head
TZGyn 2 years ago
parent 1f266b236e
commit e0d5315ae9
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

Binary file not shown.

@ -6,6 +6,7 @@
"dev": "bun run --watch src/index.ts"
},
"dependencies": {
"@elysiajs/cors": "^0.6.0",
"@types/pg": "^8.10.2",
"elysia": "latest",
"kysely": "^0.26.3",

@ -2,8 +2,9 @@ import { Elysia } from 'elysia'
import { nanoid } from 'nanoid'
import { db } from './database'
import { createLinkSchema } from './zodSchema'
import { cors } from '@elysiajs/cors'
const app = new Elysia()
const app = new Elysia().use(cors())
app.get('/', () => 'Hello Elysia')
app.get('/invalid', () => 'Invalid Shortener')

Loading…
Cancel
Save