-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (31 loc) · 820 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { render } from "@jsonresume/jsonresume-theme-professional";
import { Hono } from "hono";
import { serveStatic } from "hono/bun";
async function renderJson() {
const componentsOrder = [
"Hero",
"Summary",
"Work",
"Projects",
"Volunteer",
"Certificates",
"Education",
"Publications",
"Awards",
"Languages",
"Skills",
"Interests",
"References",
];
const jsonText = await Bun.file("./resume.json").text();
const resumeJson = await JSON.parse(jsonText);
return render(resumeJson, componentsOrder);
}
const app = new Hono();
app.get("/", async (c) => {
const html = await renderJson();
return c.html(html);
});
app.use("*", serveStatic({ root: "./public" }));
app.use("/*", serveStatic({ root: "./public", path: "index.html" }));
export default app;