Library for integrating effect runtime into fastify
npm i fastify-effect-runtime
# yarn add fastify-effect-runtime
# pnpm add fastify-effect-runtimeRegister the plugin:
import { Layer } from 'effect'
import fastifyEffectRuntime from 'fastify-effect-runtime'
const app = fastify()
await app.register(fastifyEffectRuntime, {
layers: Layer.mergeAll(YourFirstLayer, YourSecondLayer)
})Use effect inside of routes:
import { withEffect } from 'fastify-effect-runtime'
app.get('/health',
withEffect((_, reply) =>
Effect.succeed(
reply.status(200).send({ status: 'ok!' })
)
)
)If you want to contribute to improving the project, firstly read CONTRIBUTING.md
Author - Kyrylo Savieliev
fastify-effect-runtime is MIT licensed