mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-14 02:20:12 +01:00
move vector db debug endpoint to dev only
This commit is contained in:
parent
99cfee1e70
commit
bf8df60c02
@ -51,6 +51,21 @@ developerEndpoints(app, apiRouter);
|
|||||||
// Externally facing embedder endpoints
|
// Externally facing embedder endpoints
|
||||||
embeddedEndpoints(apiRouter);
|
embeddedEndpoints(apiRouter);
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV !== "development") {
|
||||||
|
app.use(
|
||||||
|
express.static(path.resolve(__dirname, "public"), { extensions: ["js"] })
|
||||||
|
);
|
||||||
|
|
||||||
|
app.use("/", function (_, response) {
|
||||||
|
response.sendFile(path.join(__dirname, "public", "index.html"));
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get("/robots.txt", function (_, response) {
|
||||||
|
response.type("text/plain");
|
||||||
|
response.send("User-agent: *\nDisallow: /").end();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Debug route for development connections to vectorDBs
|
||||||
apiRouter.post("/v/:command", async (request, response) => {
|
apiRouter.post("/v/:command", async (request, response) => {
|
||||||
try {
|
try {
|
||||||
const VectorDb = getVectorDbClass();
|
const VectorDb = getVectorDbClass();
|
||||||
@ -78,20 +93,6 @@ apiRouter.post("/v/:command", async (request, response) => {
|
|||||||
response.sendStatus(500).end();
|
response.sendStatus(500).end();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== "development") {
|
|
||||||
app.use(
|
|
||||||
express.static(path.resolve(__dirname, "public"), { extensions: ["js"] })
|
|
||||||
);
|
|
||||||
|
|
||||||
app.use("/", function (_, response) {
|
|
||||||
response.sendFile(path.join(__dirname, "public", "index.html"));
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get("/robots.txt", function (_, response) {
|
|
||||||
response.type("text/plain");
|
|
||||||
response.send("User-agent: *\nDisallow: /").end();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
app.all("*", function (_, response) {
|
app.all("*", function (_, response) {
|
||||||
|
Loading…
Reference in New Issue
Block a user