Files
XIVPlan-DB/ssr/buildPage.ts
2026-04-10 02:41:45 -04:00

35 lines
1.0 KiB
TypeScript

import { STATUS_CODE, STATUS_TEXT } from '@std/http/status';
const buildPage = (str: string) => `<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>XIVPlan+DB Manager</title>
<meta name="distribution" content="web">
<meta name="web_author" content="Ean Milligan (ean@milligan.dev)">
<meta name="author" content="Ean Milligan (ean@milligan.dev)">
<meta name="designer" content="Ean Milligan (ean@milligan.dev)">
<meta name="publisher" content="Ean Milligan (ean@milligan.dev)">
<meta name="robots" content="noindex, nofollow">
<style>
body {
background-color:black;
color:white;
}
a {
text-decoration:none;
color:white;
}
</style>
</head>
<body>
<header><h1><a href="/api/home">XIVPlan+DB Manager</a></h1></header>
<div>${str}</div>
</body>
</html>`;
const htmlHeaders = new Headers();
htmlHeaders.append('Content-Type', 'text/html');
export default (str: string) => new Response(buildPage(str), { status: STATUS_CODE.OK, statusText: STATUS_TEXT[STATUS_CODE.OK], headers: htmlHeaders });