Revert "removed cors"
All checks were successful
backend-action / build-image (push) Successful in 24s

This reverts commit 8854022fac.
This commit is contained in:
2024-05-10 09:26:41 +07:00
parent 826029ace8
commit e9b53e3e82
4 changed files with 23 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ import { createContext, router } from "./trpc";
import { createHTTPServer } from "@trpc/server/adapters/standalone";
import { userRoute } from "./userRoute";
import { runPlayground } from "./playgroud";
import cors from "cors";
import { infoRoute } from "./infoRoute";
export const appRouter = router({
@@ -14,6 +15,10 @@ async function main() {
const server = createHTTPServer({
createContext: createContext,
router: appRouter,
middleware:
(process.env.NODE_ENV ?? "development") == "production"
? undefined
: cors(),
});
server.listen(3000);