Skip to content

Commit

Permalink
Add 404 responses
Browse files Browse the repository at this point in the history
  • Loading branch information
Meldiron committed May 23, 2024
1 parent 11b615b commit 234c8aa
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions node/query-mongo-atlas/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ let client;
export default async ({ req, res, log, error }) => {
throwIfMissing(process.env, ['MONGO_URI']);

if(req.method !== 'GET') {
return res.send('Not found.', 404);
}

if (!client) {
client = await getClient();
}
Expand Down
4 changes: 4 additions & 0 deletions node/query-neo4j-auradb/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export default async ({ req, res, log, error }) => {
'NEO4J_PASSWORD',
]);

if(req.method !== 'GET') {
return res.send('Not found.', 404);
}

if (!client) {
client = await getClient();
}
Expand Down
4 changes: 4 additions & 0 deletions node/query-neon-postgres/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export default async ({ req, res, log, error }) => {
'ENDPOINT_ID'
]);

if(req.method !== 'GET') {
return res.send('Not found.', 404);
}

if (!client) {
client = await getClient();
}
Expand Down
4 changes: 4 additions & 0 deletions node/query-redis-labs/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ let client;
export default async ({ req, res, log, error }) => {
throwIfMissing(process.env, ['REDIS_HOST', 'REDIS_PASSWORD']);

if(req.method !== 'GET') {
return res.send('Not found.', 404);
}

if (!client) {
client = await getClient();
}
Expand Down
4 changes: 4 additions & 0 deletions node/query-upstash-vector/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export default async ({ req, res, log, error }) => {
'UPSTASH_TOKEN'
]);

if(req.method !== 'GET') {
return res.send('Not found.', 404);
}

if (!index) {
index = await getIndex();
}
Expand Down

0 comments on commit 234c8aa

Please sign in to comment.