feat: Структура проекта
This commit is contained in:
14
apps/backend/src/index.ts
Normal file
14
apps/backend/src/index.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { Elysia } from 'elysia';
|
||||
|
||||
const app = new Elysia()
|
||||
.onAfterHandle(({ request, set }) => {
|
||||
const origin = request.headers.get("origin");
|
||||
|
||||
if (origin === "http://localhost:8081") {
|
||||
set.headers["Access-Control-Allow-Origin"] = origin;
|
||||
}
|
||||
})
|
||||
.get('/', () => 'index')
|
||||
|
||||
export default app
|
||||
|
||||
Reference in New Issue
Block a user