[NodeJS] nodejs-express-server fix /api-docs path (#6977)

This commit is contained in:
Kim T 2020-07-20 03:57:50 -07:00 committed by GitHub
parent 1cfa8141a8
commit 383b1e9db8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ class ExpressServer {
//Send the openapi document *AS GENERATED BY THE GENERATOR* //Send the openapi document *AS GENERATED BY THE GENERATOR*
this.app.get('/openapi', (req, res) => res.sendFile((path.join(__dirname, 'api', 'openapi.yaml')))); this.app.get('/openapi', (req, res) => res.sendFile((path.join(__dirname, 'api', 'openapi.yaml'))));
//View the openapi document in a visual interface. Should be able to test from this page //View the openapi document in a visual interface. Should be able to test from this page
this.app.use('/api-doc', swaggerUI.serve, swaggerUI.setup(this.schema)); this.app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(this.schema));
this.app.get('/login-redirect', (req, res) => { this.app.get('/login-redirect', (req, res) => {
res.status(200); res.status(200);
res.json(req.query); res.json(req.query);

View File

@ -37,7 +37,7 @@ class ExpressServer {
//Send the openapi document *AS GENERATED BY THE GENERATOR* //Send the openapi document *AS GENERATED BY THE GENERATOR*
this.app.get('/openapi', (req, res) => res.sendFile((path.join(__dirname, 'api', 'openapi.yaml')))); this.app.get('/openapi', (req, res) => res.sendFile((path.join(__dirname, 'api', 'openapi.yaml'))));
//View the openapi document in a visual interface. Should be able to test from this page //View the openapi document in a visual interface. Should be able to test from this page
this.app.use('/api-doc', swaggerUI.serve, swaggerUI.setup(this.schema)); this.app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(this.schema));
this.app.get('/login-redirect', (req, res) => { this.app.get('/login-redirect', (req, res) => {
res.status(200); res.status(200);
res.json(req.query); res.json(req.query);