add markdown viewer

This commit is contained in:
Janis
2023-01-15 02:48:17 +01:00
parent 9617dc2ef3
commit a0598484b4
11 changed files with 1263 additions and 122 deletions

View File

@@ -12,18 +12,12 @@ export default async function handler(req: Request, res: Response) {
if (result !== null) {
res.end(JSON.stringify(result));
} else {
const error: ResponseError = {
code: "404",
message: "No categories found!",
};
res.status(404).send(JSON.stringify(error));
console.log("No categories found");
res.end(JSON.stringify([]));
}
})
.catch((err) => {
const error: ResponseError = {
code: "500",
message: err,
};
res.status(500).send(JSON.stringify(error));
console.log(err);
res.end(JSON.stringify([]));
});
}