Unlisted
Back
Version 41
8/27/2024
import { websiteStyles } from "https://esm.town/v/iamseeley/websiteStyles";
import { getAnalytics, trackPageView } from 'https://esm.town/v/iamseeley/webAnalyticsMod';
import React, { createContext, useContext, useState, useEffect, useRef, useCallback, useMemo } from 'https://esm.sh/react';
import { calculatePercentages } from 'https://esm.town/v/iamseeley/calculatePercentages';
import { formatSiteName } from 'https://esm.town/v/iamseeley/formatSiteName';
export const mySitesConfig = {
name: 'thomas seeley',
username: 'iamseeley',
allowedOrigins: ['https://iamseeley-htmlenergy.web.val.run', 'https://tseeley.com', "https://wando-ui.tseeley.com", "https://falbulous-minimovie.vercel.app"]
};
export default async function handler(req: Request): Promise<Response> {
const url = new URL(req.url);
const path = url.pathname;
if (path === '/') {
return serveHtml(req);
} else if (path === '/stream') {
return handleStream(req);
} else if (path === '/trackPageView') {
return handleAnalytics(req);
} else {
return new Response('Not Found', { status: 404 });
}
}
function serveHtml(req: Request): Response {
const html = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
iamseeley-countertown.web.val.run
Updated: September 10, 2024