Skip to content

Commit 35b146d

Browse files
author
Shreyas Nayak
committed
API Base URL chnaged
1 parent 06889df commit 35b146d

3 files changed

Lines changed: 14 additions & 14 deletions

File tree

index.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ app.use(bodyParser.json());
3939
/* OpenAPI DOC */
4040
const openApiFilePath = path.join(__dirname, 'openapi.json');
4141
const 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"));

openapi.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
],
2222
"paths": {
23-
"/server/health": {
23+
"/nodejsfaas/server/health": {
2424
"get": {
2525
"tags": [
2626
"Server"
@@ -52,7 +52,7 @@
5252
}
5353
}
5454
},
55-
"/function/list": {
55+
"/nodejsfaas/function/list": {
5656
"get": {
5757
"tags": [
5858
"Function"
@@ -97,7 +97,7 @@
9797
}
9898
}
9999
},
100-
"/function/{function_id}": {
100+
"/nodejsfaas/function/{function_id}": {
101101
"delete": {
102102
"tags": [
103103
"Function"
@@ -146,7 +146,7 @@
146146
}
147147
}
148148
},
149-
"/function/create": {
149+
"/nodejsfaas/function/create": {
150150
"post": {
151151
"tags": [
152152
"Function"
@@ -204,7 +204,7 @@
204204
}
205205
}
206206
},
207-
"/function/execute/{function_id}": {
207+
"/nodejsfaas/function/execute/{function_id}": {
208208
"post": {
209209
"tags": [
210210
"Function"

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)