Add projects page
This commit is contained in:
parent
232855e952
commit
f2ddb2b5c5
4 changed files with 37 additions and 4 deletions
|
|
@ -35,6 +35,20 @@ const app = new Elysia()
|
|||
return "Internal server error";
|
||||
}
|
||||
})
|
||||
.get("/projects", async ({ set }) => {
|
||||
try {
|
||||
const content = await fs.readFile(
|
||||
path.join(process.cwd(), "data/pages/projects.html"),
|
||||
"utf8",
|
||||
);
|
||||
return renderTemplate("index.html", { content });
|
||||
} catch (error) {
|
||||
console.error("Error serving main page: ", error);
|
||||
set.status = 500;
|
||||
set.headers["Content-Type"] = "text/plain";
|
||||
return "Internal server error";
|
||||
}
|
||||
})
|
||||
.get("/posts/:post_name", async ({ params, set }) => {
|
||||
try {
|
||||
const filePath = path.join(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue