mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
Formatting
This commit is contained in:
@@ -226,7 +226,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"conversations": [],
|
"conversations": [],
|
||||||
"docs_check" : {
|
"docs_check": {
|
||||||
"status": "loaded"
|
"status": "loaded"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ server.use((req, res, next) => {
|
|||||||
router.render = (req, res) => {
|
router.render = (req, res) => {
|
||||||
if (req.url === "/feedback") {
|
if (req.url === "/feedback") {
|
||||||
res.status(200).jsonp({ status: "ok" });
|
res.status(200).jsonp({ status: "ok" });
|
||||||
} else if (req.url === '/upload') {
|
} else if (req.url === "/upload") {
|
||||||
res.status(200).jsonp({
|
res.status(200).jsonp({
|
||||||
"status": "ok",
|
status: "ok",
|
||||||
"task_id": localStorage[localStorage.length - 1]
|
task_id: localStorage[localStorage.length - 1],
|
||||||
})
|
});
|
||||||
} else if (req.url.includes("/task_status")) {
|
} else if (req.url.includes("/task_status")) {
|
||||||
const taskId = req.query["task_id"];
|
const taskId = req.query["task_id"];
|
||||||
const taskIdExists = localStorage.includes(taskId);
|
const taskIdExists = localStorage.includes(taskId);
|
||||||
@@ -49,7 +49,16 @@ router.render = (req, res) => {
|
|||||||
} else {
|
} else {
|
||||||
res.status(404).jsonp({});
|
res.status(404).jsonp({});
|
||||||
}
|
}
|
||||||
}else {
|
} else if (req.url === "/stream") {
|
||||||
|
res.status(200).jsonp({
|
||||||
|
data: "The answer is 42",
|
||||||
|
sources: [
|
||||||
|
"https://en.wikipedia.org/wiki/42_(number)",
|
||||||
|
"https://en.wikipedia.org/wiki/42_(number)",
|
||||||
|
],
|
||||||
|
conversation_id: "1234",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
res.status(res.statusCode).jsonp(res.locals.data);
|
res.status(res.statusCode).jsonp(res.locals.data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user