@@ -39,7 +39,7 @@ app.use(bodyParser.json());
3939/* OpenAPI DOC */
4040const openApiFilePath = path . join ( __dirname , 'openapi.json' ) ;
4141const openApiDocument = JSON . parse ( fs . readFileSync ( openApiFilePath , 'utf8' ) ) ;
42- app . use ( '/api-docs' , swaggerUi . serve , swaggerUi . setup ( openApiDocument ) ) ;
42+ app . use ( '/nodejsfaas/ api-docs' , swaggerUi . serve , swaggerUi . setup ( openApiDocument ) ) ;
4343
4444
4545/* Security Middleware */
@@ -65,18 +65,18 @@ const authenticateToken = (req, res, next) => {
6565 req . decoded = decoded ;
6666 next ( ) ;
6767 } ) ;
68- } ;
68+ } ;
6969
7070
71- app . get ( '/server/health' , ( req , res ) => {
71+ app . get ( '/nodejsfaas/ server/health' , ( req , res ) => {
7272 res . status ( 200 ) . send ( 'OK' ) ;
7373} ) ;
7474
75- app . head ( '/server/health' , ( req , res ) => {
75+ app . head ( '/nodejsfaas/ server/health' , ( req , res ) => {
7676 res . status ( 200 ) . send ( ) ;
7777} ) ;
7878
79- app . get ( '/function/list' , authenticateToken , ( req , res ) => {
79+ app . get ( '/nodejsfaas/ function/list' , authenticateToken , ( req , res ) => {
8080 fs . readdir ( `functions/${ req . decoded . namespace } ` , ( err , files ) => {
8181 if ( err ) {
8282 return res . status ( 500 ) . json ( {
@@ -101,7 +101,7 @@ app.get('/function/list', authenticateToken, (req, res) => {
101101 } ) ;
102102} ) ;
103103
104- app . post ( '/function/create' , authenticateToken , upload . single ( 'file' ) , ( req , res ) => {
104+ app . post ( '/nodejsfaas/ function/create' , authenticateToken , upload . single ( 'file' ) , ( req , res ) => {
105105 if ( ! req . file ) {
106106 return res . status ( 400 ) . json ( {
107107 "status" : "ERROR" ,
@@ -134,7 +134,7 @@ app.post('/function/create', authenticateToken, upload.single('file'), (req, res
134134 } ) ;
135135} ) ;
136136
137- app . delete ( '/function/:function_id' , authenticateToken , ( req , res ) => {
137+ app . delete ( '/nodejsfaas/ function/:function_id' , authenticateToken , ( req , res ) => {
138138 const function_id = req . params . function_id ;
139139 const file_name = `${ function_id } .mjs` ;
140140
@@ -157,7 +157,7 @@ app.delete('/function/:function_id', authenticateToken, (req, res) => {
157157 } ) ;
158158} ) ;
159159
160- app . post ( '/function/execute/:function_id' , authenticateToken , async ( req , res ) => {
160+ app . post ( '/nodejsfaas/ function/execute/:function_id' , authenticateToken , async ( req , res ) => {
161161 await new Promise ( ( resolve , reject ) => {
162162 if ( ! req . body || Object . keys ( req . body ) . length === 0 ) {
163163 reject ( new Error ( "Request body is empty or not valid JSON" ) ) ;
0 commit comments