mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-06 22:25:55 -04:00
Hide local endpoints when deployed
This commit is contained in:
@@ -464,33 +464,35 @@ swaggerDocument.paths["/internal/send-search-notifications"] = {
|
||||
},
|
||||
} as any
|
||||
|
||||
|
||||
// Local Endpoints
|
||||
app.post(pathWithPrefix("/local/send-test-email"),
|
||||
async (req, res) => {
|
||||
if (!IS_LOCAL) {
|
||||
return res.status(401).json({error: "Unauthorized"});
|
||||
}
|
||||
if (IS_LOCAL) {
|
||||
app.post(pathWithPrefix("/local/send-test-email"),
|
||||
async (req, res) => {
|
||||
if (!IS_LOCAL) {
|
||||
return res.status(401).json({error: "Unauthorized"});
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await localSendTestEmail()
|
||||
return res.status(200).json(result)
|
||||
} catch (err) {
|
||||
return res.status(500).json({error: err});
|
||||
try {
|
||||
const result = await localSendTestEmail()
|
||||
return res.status(200).json(result)
|
||||
} catch (err) {
|
||||
return res.status(500).json({error: err});
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
swaggerDocument.paths["/local/send-test-email"] = {
|
||||
post: {
|
||||
summary: "Send a test email",
|
||||
description: "Local endpoint to send a test email.",
|
||||
tags: ["Local"],
|
||||
requestBody: {
|
||||
required: false,
|
||||
);
|
||||
swaggerDocument.paths["/local/send-test-email"] = {
|
||||
post: {
|
||||
summary: "Send a test email",
|
||||
description: "Local endpoint to send a test email.",
|
||||
tags: ["Local"],
|
||||
requestBody: {
|
||||
required: false,
|
||||
},
|
||||
responses: responses,
|
||||
},
|
||||
responses: responses,
|
||||
},
|
||||
} as any
|
||||
} as any
|
||||
}
|
||||
|
||||
|
||||
const rootPath = pathWithPrefix("/")
|
||||
|
||||
Reference in New Issue
Block a user