swagger improvements
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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(),
|
||||||
|
|||||||
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user