sonic-express
sonic-express copied to clipboard
Can I group the routes based on say resource groups?
Is your feature request related to a problem? Please describe.
Can I set up sonic-express to group the routes based on resource groups?
It currently just dumps everything inside a default
group.
So, is there a way to set up in such a way that I have business profile
and customer-exemption
groups?
Describe the solution you'd like A clear and concise description of what you want to happen.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context This is my setup.
const swaggerSpecPath = path.join(__dirname, '../../docs', 'swagger.json');
const { getResponseExpress } = require('@tiemma/sonic-express');
const swaggerDefinition = {
openapi: '3.0.1',
info: {
title: 'AtomicKit Server',
version: process.env.npm_package_version,
description: 'Tax Software For Businesses',
},
servers: [
{
url: '/api/v1',
description: 'Host system path',
},
],
definitions: {},
produces: [
'application/json',
],
consumes: [
'application/json',
],
schemes: ['http', 'https'],
paths: {},
tags: ['account', 'auth', 'location'],
components: {
securitySchemes: {
jwtAuth: {
type: 'apiKey',
description: 'Use your token here',
in: 'header',
name: 'authorization',
},
},
},
security: [
{
jwtAuth: [],
},
],
};
const options = (fileName) => ({
// import swaggerDefinitions
swaggerDefinition,
// path to the API docs
apis: [fileName],
});
application.use(getResponseExpress(application, options(__filename), swaggerSpecPath));