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
|
||||
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) => {
|
||||
try {
|
||||
const VectorDb = getVectorDbClass();
|
||||
@ -78,20 +93,6 @@ apiRouter.post("/v/:command", async (request, response) => {
|
||||
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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user