#Mounting an Effect HTTP API
8 messages · Page 1 of 1 (latest)
Perhaps something like the following?:
import { HttpLayerRouter } from "@effect/platform"
import { createFileRoute } from "@tanstack/react-router"
import { ApiLive } from "~/api/ApiLive"
const { handler: webHandler } = HttpLayerRouter.toWebHandler(ApiLive)
const handler = ({ request }: { request: Request }) => webHandler(request)
export const Route = createFileRoute("/api/v1/$")({
server: {
handlers: {
GET: handler,
POST: handler,
OPTIONS: handler,
ALL: handler,
HEAD: handler,
DELETE: handler,
PUT: handler,
PATCH: handler,
},
},
})
Thank you!
@austere plover did that work? I have been thinking about trying the same
it should just work. if not please let us know
I ended up switching to just Effect Platform for my back end + using TanStack router on the front end (not start)