From: charleswrayjr Date: Sat, 27 Sep 2025 03:20:15 +0000 (-0500) Subject: Removing zencoder from .gitignore and fixing some issues in swagger.json #PA-2. X-Git-Url: https://git.phasecustomsoft.com/?a=commitdiff_plain;h=7749c000f65abcfa9133066d432b91070c1572d0;p=phs-api.git Removing zencoder from .gitignore and fixing some issues in swagger.json #PA-2. --- diff --git a/.gitignore b/.gitignore index ce74ae4..a3eed70 100755 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules/ pm2logs/ **/.DS_Store/ logs/ -bin/ \ No newline at end of file +bin/ +npmcache/ \ No newline at end of file diff --git a/.idea/zencoder-chat-index.xml b/.idea/zencoder-chat-index.xml index 2009da4..28ae7b1 100755 --- a/.idea/zencoder-chat-index.xml +++ b/.idea/zencoder-chat-index.xml @@ -1,6 +1,7 @@ - \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100755 index 0000000..7cc1863 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +cache=./npmcache diff --git a/src/routes/index.js b/src/routes/index.js index 9df7086..d92089a 100755 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -5,6 +5,8 @@ const express = require( 'express' ); const router = express.Router(); +const swaggerUi = require( 'swagger-ui-express' ); +const swaggerDocument = require( '../../src/swagger.json' ); /** * Configure API routes @@ -12,6 +14,16 @@ const router = express.Router(); * @returns {Object} Express router with API routes */ module.exports.APIRoutes = ( passport ) => { + + +// Swagger documentation + // noinspection JSCheckFunctionSignatures + router.use( '/api-docs', swaggerUi.serve, swaggerUi.setup( swaggerDocument ) ); + router.get( '/swagger.json', ( req, res ) => { + res.setHeader( 'Content-Type', 'application/json' ); + res.send( swaggerDocument ); + } ); + router.use( '/git', require( './git.routes' )( passport ) ); router.use( '/docker', require( './docker.routes' )( passport ) ); router.use( '/vpn', require( './vpn.routes' )( passport ) ); diff --git a/src/swagger.json b/src/swagger.json index 8c330fb..838d7fe 100755 --- a/src/swagger.json +++ b/src/swagger.json @@ -13,7 +13,7 @@ } }, "schemes": ["https", "http"], - "host": "api-phasecustomsoft.com", + "host": "api.phasecustomsoft.com", "basePath": "/", "securityDefinitions": { "Bearer": {