feat: initial app prototype

This commit is contained in:
2025-01-20 18:36:05 -08:00
parent 3abc3e3272
commit d7cd3ffaab
21 changed files with 5187 additions and 0 deletions

30
src/server/serve.ts Normal file
View File

@ -0,0 +1,30 @@
/**
* @copyright nhcarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
import fastify from "fastify";
import { generateHtml } from "../modules/generateHtml.js";
import { sendDebugLog } from "../utils/sendDebugLog.js";
import type { App } from "../interfaces/app.js";
/**
* Instantiates the fastify server.
* @param app - The application instance.
*/
export const serve = (app: App): void => {
const server = fastify({
logger: false,
});
server.get("/", (_request, response) => {
response.header("Content-Type", "text/html");
response.send(generateHtml(app));
});
server.listen({ port: 12_443 }, () => {
void sendDebugLog({
content: "Server listening on port 12443.",
});
});
};