Skip to content

Commit

Permalink
Remove swagger prefix from staging ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadranjbarz committed May 20, 2024
1 parent 482f888 commit d1c286c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ const {version} = require('../package.json');
const app = express();

swaggerDocument.info.version = version
swaggerDocument.basePath = process.env.NODE_ENV === 'staging' ? '/staging' : '/'
const swaggerPrefix = process.env.NODE_ENV === 'staging' ? '/staging' : ''

// swaggerDocument.basePath = process.env.NODE_ENV === 'staging' ? '/staging' : '/'
// const swaggerPrefix = process.env.NODE_ENV === 'staging' ? '/staging' : ''
// https://stackoverflow.com/a/58052537/4650625
app.use(`${swaggerPrefix}/api-docs`, swaggerUi.serve, swaggerUi.setup(swaggerDocument));
// app.use(`${swaggerPrefix}/api-docs`, swaggerUi.serve, swaggerUi.setup(swaggerDocument));

app.use(`/api-docs`, swaggerUi.serve, swaggerUi.setup(swaggerDocument));

app.get(`/calculate`,
async (req: Request, res: Response) => {
Expand Down

0 comments on commit d1c286c

Please sign in to comment.