@aiendpoint/fastify
v0.2.0
Published
Serve your /ai endpoint from Fastify in one line
Maintainers
Readme
@aiendpoint/fastify
Serve your /ai endpoint from Fastify in one line.
Install
npm install @aiendpoint/fastifyUsage
import Fastify from 'fastify'
import aiendpoint from '@aiendpoint/fastify'
const app = Fastify()
app.register(aiendpoint, { spec: './ai.json' })
app.listen({ port: 3000 })That's it. GET /ai now serves your spec.
Options
app.register(aiendpoint, {
spec: './ai.json', // path to spec file, or inline object
path: '/ai', // route path (default: '/ai')
maxAge: 3600, // Cache-Control max-age (default: 3600)
})Generate ai.json
npx @aiendpoint/cli init --openapi https://your-api.com/openapi.json