diff --git a/utopia-remix/app/util/api.server.ts b/utopia-remix/app/util/api.server.ts index fd46d77e86b7..79e36823850b 100644 --- a/utopia-remix/app/util/api.server.ts +++ b/utopia-remix/app/util/api.server.ts @@ -1,6 +1,6 @@ import { TypedResponse, json } from "@remix-run/node"; import invariant from "tiny-invariant"; -import { Env } from "../env.server"; +import { ServerEnvironment } from "../env.server"; import { Status } from "./statusCodes.server"; import { Method, isMethod } from "./methods.server"; @@ -13,13 +13,13 @@ type EmptyResponse = Record; export type ApiResponse = TypedResponse; const responseHeaders: HeadersInit = { - "Access-Control-Allow-Origin": Env.CORSOrigin, + "Access-Control-Allow-Origin": ServerEnvironment.CORSOrigin, "Access-Control-Allow-Credentials": "true", "Access-Control-Allow-Headers": "content-type, origin, cookie", "Access-Control-Allow-Methods": "GET,POST,PUT,DELETE,OPTIONS", }; -export async function handleOptions() { +export async function handleOptions(): Promise> { return json({}, { headers: responseHeaders }); } @@ -28,7 +28,7 @@ export function handle( handlers: { [method in Method]?: (request: Request) => Promise; }, -) { +): Promise { const invalidMethod = new ApiError( "invalid method", Status.METHOD_NOT_ALLOWED,