Bruce Nduko
All projects
LiveWeb

tijalabs.com

Tija Labs' company website.

tijalabs.com
tijalabs.com screenshot

Problem

Tija Labs needed a public home with a working contact channel.

What I built

The company website, on a custom domain, with contact form delivery and a blog.

Stack

WebCustom domain

The kind of code behind it

1type ProjectStatus = "live" | "checking";
2
3async function checkUrl(url: string): Promise<boolean> {
4 const controller = new AbortController();
5 const timeout = setTimeout(() => controller.abort(), 6000);
6
7 try {
8 const res = await fetch(url, {
9 method: "GET",
10 redirect: "follow",
11 signal: controller.signal,
12 });
13 return res.ok;
14 } catch {
15 // Never surface "down" on a failed check — only "live" or "checking".
16 return false;
17 } finally {
18 clearTimeout(timeout);
19 }
20}
21
22export async function checkAll(
23 targets: { slug: string; url: string }[]
24): Promise<Record<string, ProjectStatus>> {
25 const entries = await Promise.all(
26 targets.map(async (t) => {
27 const ok = await checkUrl(t.url);
28 return [t.slug, ok ? "live" : "checking"] as const;
29 })
30 );
31
32 return Object.fromEntries(entries);
33}