Skip to content

Commit d6f6f86

Browse files
committed
Add landing page easter egg and remove orphan health.ts
SSR page on "/" reads APP_URL from env to link to the dashboard. Delete leftover Hono health route (replaced by SvelteKit routes).
1 parent 89d16be commit d6f6f86

6 files changed

Lines changed: 179 additions & 69 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"format": "prettier --write .",
2020
"generate-types": "bun scripts/generate-types.ts",
2121
"clean": "rimraf .svelte-kit build node_modules",
22-
"deploy:dev": "ow dev worker upload openworkers-api ./build",
23-
"deploy:local": "ow local worker upload openworkers-api ./build",
24-
"deploy:main": "ow main worker upload openworkers-api ./build"
22+
"deploy:dev": "bun run build && ow dev worker upload openworkers-api ./build",
23+
"deploy:local": "bun run build && ow local worker upload openworkers-api ./build",
24+
"deploy:main": "bun run build && ow main worker upload openworkers-api ./build"
2525
},
2626
"dependencies": {
2727
"@openworkers/croner-wasm": "^0.3.1",

src/routes/+page.server.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { env } from '$env/dynamic/private';
2+
3+
export function load() {
4+
return {
5+
dashboardUrl: env.APP_URL || 'https://dash.openworkers.com'
6+
};
7+
}

src/routes/+page.svelte

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
<script lang="ts">
2+
let { data } = $props();
3+
</script>
4+
5+
<svelte:head>
6+
<title>OpenWorkers API</title>
7+
<meta name="robots" content="noindex, nofollow" />
8+
<link rel="icon" href="https://openworkers.com/favicon.ico" />
9+
<style>
10+
* { box-sizing: border-box; margin: 0; padding: 0; }
11+
12+
body {
13+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
14+
background: #09090b;
15+
color: #fafafa;
16+
min-height: 100vh;
17+
display: flex;
18+
flex-direction: column;
19+
}
20+
</style>
21+
</svelte:head>
22+
23+
<main>
24+
<div class="content">
25+
<div class="header">
26+
<a href="https://openworkers.com" class="logo">
27+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 283.46 283.46"><path d="m205.14,205.14l-95.11-95.12,31.71-31.71,63.41,63.41,63.38-63.39C245.26,31.89,197.22,0,141.73,0S38.21,31.89,14.94,78.34l95.09,95.1-31.7,31.7L.71,127.52c-.47,4.67-.71,9.41-.71,14.21,0,78.28,63.46,141.73,141.73,141.73s141.73-63.46,141.73-141.73c0-4.8-.24-9.54-.71-14.21l-77.62,77.62Z" fill="white"></path></svg>
28+
OpenWorkers
29+
</a>
30+
<span class="badge">API</span>
31+
</div>
32+
33+
<h1>Well, hello there.</h1>
34+
35+
<p class="description">
36+
This is the API backend. Not much to see here, but you found it.
37+
</p>
38+
39+
<a href={data.dashboardUrl} class="btn">
40+
Take me to the Dashboard
41+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
42+
<path d="M5 12h14M12 5l7 7-7 7"/>
43+
</svg>
44+
</a>
45+
</div>
46+
</main>
47+
48+
<footer>
49+
<p>
50+
<a href="https://openworkers.com">openworkers.com</a> &middot;
51+
<a href="https://github.com/openworkers">GitHub</a>
52+
</p>
53+
</footer>
54+
55+
<style>
56+
main {
57+
flex: 1;
58+
display: flex;
59+
align-items: center;
60+
justify-content: center;
61+
padding: 2rem;
62+
}
63+
64+
.content {
65+
max-width: 420px;
66+
text-align: center;
67+
}
68+
69+
.header {
70+
display: flex;
71+
align-items: center;
72+
justify-content: space-between;
73+
gap: 1rem;
74+
margin-bottom: 2.5rem;
75+
}
76+
77+
.logo {
78+
display: inline-flex;
79+
align-items: center;
80+
gap: 0.6rem;
81+
font-weight: 600;
82+
font-size: 1.1rem;
83+
color: #fafafa;
84+
text-decoration: none;
85+
}
86+
87+
.logo svg {
88+
width: 32px;
89+
height: 32px;
90+
}
91+
92+
.badge {
93+
background: #18181b;
94+
border: 1px solid #27272a;
95+
border-radius: 9999px;
96+
padding: 0.4rem 1rem;
97+
font-size: 0.8rem;
98+
font-weight: 500;
99+
color: #a1a1aa;
100+
}
101+
102+
h1 {
103+
font-size: 2.25rem;
104+
font-weight: 600;
105+
letter-spacing: -0.025em;
106+
line-height: 1.2;
107+
margin-bottom: 1rem;
108+
}
109+
110+
.description {
111+
color: #71717a;
112+
font-size: 1.05rem;
113+
line-height: 1.6;
114+
margin-bottom: 2.5rem;
115+
}
116+
117+
.btn {
118+
display: flex;
119+
align-items: center;
120+
justify-content: center;
121+
gap: 0.5rem;
122+
width: 100%;
123+
padding: 0.875rem 1.5rem;
124+
font-size: 0.95rem;
125+
font-weight: 500;
126+
color: #09090b;
127+
background: #fafafa;
128+
border: none;
129+
border-radius: 10px;
130+
text-decoration: none;
131+
cursor: pointer;
132+
transition: background 0.15s;
133+
}
134+
135+
.btn:hover {
136+
background: #e4e4e7;
137+
}
138+
139+
.btn svg {
140+
transition: transform 0.15s;
141+
}
142+
143+
.btn:hover svg {
144+
transform: translateX(2px);
145+
}
146+
147+
footer {
148+
padding: 1.5rem 2rem;
149+
text-align: center;
150+
border-top: 1px solid #18181b;
151+
}
152+
153+
footer p {
154+
font-size: 0.8rem;
155+
color: #52525b;
156+
}
157+
158+
footer a {
159+
color: #71717a;
160+
text-decoration: none;
161+
transition: color 0.15s;
162+
}
163+
164+
footer a:hover {
165+
color: #a1a1aa;
166+
}
167+
</style>

src/routes/+page.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const ssr = true;

src/routes/health.ts

Lines changed: 0 additions & 65 deletions
This file was deleted.

svelte.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import type { Config } from '@sveltejs/kit';
33

44
const config: Config = {
55
kit: {
6+
inlineStyleThreshold: Number.POSITIVE_INFINITY,
67
adapter: adapter({ functions: false, debug: { prettier: false } }),
78
csrf: {
89
trustedOrigins: ['*']
910
},
10-
// API-only: no prerendering
1111
prerender: {
1212
entries: []
1313
}

0 commit comments

Comments
 (0)