refactor api
This commit is contained in:
@@ -13,6 +13,9 @@ async function bootstrap() {
|
||||
credentials: true,
|
||||
});
|
||||
|
||||
// set base path for api
|
||||
app.setGlobalPrefix(process.env.API_PATH ?? '/v1');
|
||||
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('EPESS API')
|
||||
.setDescription('API documentation for EPESS application')
|
||||
@@ -22,9 +25,13 @@ async function bootstrap() {
|
||||
|
||||
const document = SwaggerModule.createDocument(app, config);
|
||||
SwaggerModule.setup(process.env.SWAGGER_PATH ?? 'v1', app, document);
|
||||
console.log(process.env.API_PATH);
|
||||
|
||||
|
||||
document.paths['/graphql'] = {
|
||||
|
||||
document.paths[process.env.API_PATH + '/graphql'] = {
|
||||
get: {
|
||||
tags: ['GraphQL'],
|
||||
summary: 'GraphQL Playground',
|
||||
description:
|
||||
'Access the GraphQL Playground to interact with the GraphQL API.',
|
||||
|
||||
Reference in New Issue
Block a user