Effect CommunityEC
Effect Communityβ€’11mo agoβ€’
24 replies
hazlo.oOo

Combining HttpApi with Custom Routes in Effect Typescript Library

Hi there, loving the
HttpApi
stuff so far, works really well (the OpenAPI schema generation is awesome in particular, I'm using it with swift-openapi-generator to get a really nice typesafe API in my Swift app)!

One crucial thing I haven't been able to understand from the docs is how I can attach some more routes using a
HttpRouter
outside of the
HttpApi
. For example, I'd like to have my API define most of the routes, but then to also have some other "non-API" routes, like
/
, /health, serving static files, etc.

I've tried some different solutions, like using HttpApiBuilder.httpApp and then somehow manipulating the Router, but the types aren't really matching up, and I'm a bit stuck πŸ™‚

Appreciate any help, thanks a lot!
Was this page helpful?