macbook 에서 리눅스로 이동
This commit is contained in:
24
backend/main.ts
Normal file
24
backend/main.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Elysia } from "elysia";
|
||||
import cors from "@elysiajs/cors";
|
||||
|
||||
const app = new Elysia().use(
|
||||
cors({
|
||||
origin: ["http://127.0.0.1:3000", "http://localhost:3000"],
|
||||
credentials: true,
|
||||
}),
|
||||
);
|
||||
|
||||
app.get("/", () => ({
|
||||
service: "landing-backend",
|
||||
status: "ok",
|
||||
}));
|
||||
|
||||
app.get("/health", () => ({
|
||||
status: "ok",
|
||||
}));
|
||||
|
||||
const port = Number(process.env.PORT ?? 4000);
|
||||
const hostname = process.env.HOST ?? "127.0.0.1";
|
||||
const server = app.listen({ port, hostname });
|
||||
|
||||
console.log(`Backend listening on ${server.server!.url}`);
|
||||
Reference in New Issue
Block a user