swagger improvements

This commit is contained in:
2025-09-10 05:19:56 +00:00
parent 4f82fc4be3
commit e03c777921
3 changed files with 7 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ const createApi = async (options: CreateApiOptions) => {
openapi: { openapi: {
info: { info: {
title: 'FluxCurrent', title: 'FluxCurrent',
description: 'Sample backend service', description: 'A home for all data',
version: '1.0.0', version: '1.0.0',
}, },
tags: [ tags: [
@@ -37,6 +37,10 @@ const createApi = async (options: CreateApiOptions) => {
await app.register(fastifyApiReference, { await app.register(fastifyApiReference, {
routePrefix: '/docs', routePrefix: '/docs',
configuration: {
theme: 'elysiajs',
pageTitle: 'FluxCurrent API',
},
}); });
await app.register(FastifySSEPlugin); await app.register(FastifySSEPlugin);

View File

@@ -12,7 +12,7 @@ const streamEndpoint: FastifyPluginAsyncZod<{ services: Services }> = async (fas
url: '/documents', url: '/documents',
schema: { schema: {
operationId: 'get.stream.documents', operationId: 'get.stream.documents',
summary: 'Stream documents matching a query', summary: 'Subscribe to documents matching a query',
tags: ['streams', 'documents'], tags: ['streams', 'documents'],
querystring: z.object({ querystring: z.object({
query: z.string().optional(), query: z.string().optional(),

View File

@@ -6,3 +6,4 @@ const services = new Services();
const api = await createApi({ services }); const api = await createApi({ services });
await api.listen({ port: 3000 }); await api.listen({ port: 3000 });
console.log('Started');