Swagger
#404
Replies: 1 comment
-
Hi @totaland. I understand and making it work harder but it may be broken due of automated dependabot updates. As i working on full-time job and no sponsors here i have to work more. I may look later to what can be done or fixed but i should say it's not near within month, maybe in vacation i'll look. Thank you for interest and trying out nanoexpress. Sorry for these bugs, hope you understand |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can't seem to make the swagger work, all the sockets, and rest-api work fine.
I try to build the project with SWC and everything is fine until I try to add swagger. I follow the example with cjs but it didn't work.
export const swaggerDocument = { openapi: '3.0.1', info: { version: '1.0.0', title: 'APIs Document', description: 'your description here', termsOfService: '', contact: { name: 'blah blah', email: 'some email', url: 'some url' }, license: { name: 'Apache 2.0', url: 'https://www.apache.org/licenses/LICENSE-2.0.html' } } }
const swaggerUi = require('swagger-ui-express') const app = nanoexpress() app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument))
This method seems to build fine but when I try to access the /api-docs nothing work.
https://github.com/nanoexpress/middlewares/tree/master/packages/schemator/examples
I follow this examples
`const bodyParser = require('@nanoexpress/middleware-schemator/cjs');
const schematorInstance = schemator({ swaggerPath: './swagger.yml' });
app.define(schematorInstance.define);
app.get(
'/auth',
// Here any body-parser, form-data logic (all preprocess middlewares)
schematorInstance.load({
attach: '/auth',
method: 'get',
path: './auth/docs.yml'
}),
async (req) => {
// your logic here
}
);`
Does not work either...
Could you guide me to the right direction?
Beta Was this translation helpful? Give feedback.
All reactions