
📦 @scaleleap/fastify
Fastify helpers.
Usage
import { createServer, createRoute, createSchema, typebox } from '../src'
import { createLogger } from '@scaleleap/logger'
const { server, listen } = createServer({
logger: createLogger(),
})
server.route(
createRoute(
{
method: 'GET',
url: '/',
handler: async (req, res) => ({ page: req.query.page }),
},
createSchema({
querystring: typebox.Type.Object({
page: typebox.Type.Number({ minimum: 1, maximum: 99 }),
}),
}),
),
)
listen()
You can also find the runnable example in test/server.ts
Download & Installation
$ npm i -s @scaleleap/fastify
Contributing
This repository uses Conventional Commit style commit messages.
Authors or Acknowledgments
License
This project is licensed under the MIT License.
Badges
