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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { resumeSetup } from 'https://esm.town/v/iamseeley/resumeSetup';
import { renderResume } from 'https://esm.town/v/iamseeley/renderResume';
import { helloResume } from 'https://esm.town/v/iamseeley/helloResume';
import { resumeConfig } from 'https://esm.town/v/iamseeley/thomasResumeConfig';
export default async function resumeHandler(req: Request): Promise<Response> {
if (req.method === 'GET') {
try {
const config = await resumeSetup(resumeConfig);
if (!config.resumeDetails || Object.keys(config.resumeDetails).length === 0) {
const htmlMessage = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>hello, resume</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><text y='50%' font-size='24' text-anchor='middle' x='50%' dy='.3em'>πŸ“„</text></svg>">
<style>
${helloResume}
</style>
</head>
<body>
<!-- Your existing landing page content -->
</body>
</html>
`;
return new Response(htmlMessage, { headers: { 'Content-Type': 'text/html' } });
}
// Add OG image URL and custom title to the config
const ogImageUrl = 'https://tseeley.com/images/ufoog.JPG'; // Replace with your actual OG image URL
const customTitle = `resume ✦ thomas seeley`; // You can customize this as needed
const resumeHTML = renderResume({
...config,
ogImageUrl,
customTitle
});
return new Response(resumeHTML, { headers: { 'Content-Type': 'text/html' } });
} catch (error) {
console.error("Error in handler:", error);
return new Response(`Error: ${error.message}`, { status: 400 });
}
} else {
return new Response('Method Not Allowed', { status: 405 });
}
}