-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
305 lines (293 loc) · 8.44 KB
/
Copy pathapp.py
File metadata and controls
305 lines (293 loc) · 8.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
app = FastAPI()
WELCOME_HTML = """<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>You shipped on Clue2App!</title>
<style>
:root {
--c1: #EA580C;
--c2: #F97316;
--c3: #FB923C;
--ink: #1f2937;
--ink-soft: #4b5563;
--muted: #6b7280;
--bg: #fff7ed;
--card: #ffffff;
--line: rgba(234, 88, 12, 0.12);
--shadow: 0 10px 30px rgba(234, 88, 12, 0.08), 0 2px 6px rgba(17, 24, 39, 0.04);
}
* { box-sizing: border-box; }
html, body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
color: var(--ink);
background:
radial-gradient(1200px 600px at 80% -10%, rgba(251, 146, 60, 0.25), transparent 60%),
radial-gradient(900px 500px at -10% 10%, rgba(234, 88, 12, 0.18), transparent 60%),
linear-gradient(180deg, #fffaf5 0%, #fff7ed 100%);
min-height: 100vh;
-webkit-font-smoothing: antialiased;
}
.wrap {
max-width: 1080px;
margin: 0 auto;
padding: 56px 24px 80px;
}
.hero {
text-align: center;
padding: 56px 24px 32px;
}
.rocket {
font-size: 88px;
line-height: 1;
display: inline-block;
filter: drop-shadow(0 6px 18px rgba(234, 88, 12, 0.35));
animation: float 3.6s ease-in-out infinite;
}
@keyframes float {
0%, 100% { transform: translateY(0) rotate(-8deg); }
50% { transform: translateY(-10px) rotate(-4deg); }
}
h1 {
font-size: clamp(36px, 6vw, 64px);
line-height: 1.05;
margin: 20px 0 14px;
letter-spacing: -0.02em;
background: linear-gradient(90deg, var(--c1), var(--c2) 50%, var(--c3));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.sub {
font-size: clamp(16px, 2vw, 20px);
color: var(--ink-soft);
max-width: 720px;
margin: 0 auto;
}
.stack-pill {
display: inline-flex;
align-items: center;
gap: 8px;
margin-top: 22px;
padding: 8px 14px;
border-radius: 999px;
background: rgba(234, 88, 12, 0.08);
color: var(--c1);
font-weight: 600;
font-size: 13px;
letter-spacing: 0.02em;
border: 1px solid var(--line);
}
.stack-pill .dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: linear-gradient(135deg, var(--c1), var(--c3));
box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}
section {
margin-top: 56px;
}
.section-title {
font-size: 13px;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--c1);
margin: 0 0 18px;
text-align: center;
}
.section-lede {
text-align: center;
color: var(--muted);
margin: 0 0 28px;
font-size: 15px;
}
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 18px;
}
@media (max-width: 820px) {
.grid { grid-template-columns: 1fr; }
}
.card {
background: var(--card);
border: 1px solid var(--line);
border-radius: 18px;
padding: 22px 22px 20px;
box-shadow: var(--shadow);
position: relative;
overflow: hidden;
transition: transform 160ms ease, box-shadow 160ms ease;
}
.card:hover {
transform: translateY(-2px);
box-shadow: 0 16px 40px rgba(234, 88, 12, 0.12), 0 4px 10px rgba(17, 24, 39, 0.06);
}
.card .step {
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 10px;
background: linear-gradient(135deg, var(--c1), var(--c3));
color: white;
font-weight: 700;
font-size: 14px;
margin-bottom: 14px;
box-shadow: 0 6px 14px rgba(234, 88, 12, 0.3);
}
.card h3 {
margin: 0 0 6px;
font-size: 17px;
letter-spacing: -0.01em;
}
.card p {
margin: 0;
color: var(--ink-soft);
font-size: 14px;
line-height: 1.5;
}
.card code {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
background: rgba(234, 88, 12, 0.08);
color: var(--c1);
padding: 2px 6px;
border-radius: 6px;
font-size: 13px;
}
.cta {
display: flex;
flex-direction: column;
height: 100%;
}
.cta .body { flex: 1; }
.cta a.btn {
display: inline-flex;
align-items: center;
gap: 6px;
margin-top: 16px;
padding: 9px 14px;
border-radius: 10px;
background: linear-gradient(135deg, var(--c1), var(--c2));
color: white;
text-decoration: none;
font-weight: 600;
font-size: 14px;
box-shadow: 0 6px 14px rgba(234, 88, 12, 0.28);
transition: transform 120ms ease, box-shadow 120ms ease;
align-self: flex-start;
}
.cta a.btn:hover {
transform: translateY(-1px);
box-shadow: 0 10px 22px rgba(234, 88, 12, 0.34);
}
.cta a.btn.ghost {
background: white;
color: var(--c1);
border: 1px solid var(--line);
box-shadow: var(--shadow);
}
.icon {
font-size: 22px;
margin-bottom: 12px;
display: inline-block;
}
footer {
margin-top: 72px;
padding: 28px 0 8px;
text-align: center;
color: var(--muted);
font-size: 14px;
border-top: 1px solid var(--line);
}
footer a {
color: var(--c1);
text-decoration: none;
font-weight: 600;
}
footer a:hover { text-decoration: underline; }
</style>
</head>
<body>
<main class="wrap">
<div class="hero">
<div class="rocket" aria-hidden="true">🚀</div>
<h1>You shipped on Clue2App!</h1>
<p class="sub">Your Python 3 / FastAPI / Uvicorn app is live and serving at this URL.</p>
<div class="stack-pill"><span class="dot"></span> Python 3 · FastAPI · Uvicorn</div>
</div>
<section>
<p class="section-title">What just happened</p>
<p class="section-lede">Three things had to go right. They all did.</p>
<div class="grid">
<div class="card">
<div class="step">1</div>
<h3>Code pushed to git</h3>
<p><code>clue2solve/DemoPythonFastApi</code></p>
</div>
<div class="card">
<div class="step">2</div>
<h3>Built by Clue2App</h3>
<p>Buildpacks auto-detected your stack — no Dockerfile needed.</p>
</div>
<div class="card">
<div class="step">3</div>
<h3>Deployed live</h3>
<p>Knative serves your app and auto-scales it.</p>
</div>
</div>
</section>
<section>
<p class="section-title">What's next</p>
<p class="section-lede">Make it yours.</p>
<div class="grid">
<div class="card cta">
<div class="body">
<div class="icon" aria-hidden="true">✏️</div>
<h3>Edit this page</h3>
<p>Open <code>app.py</code> to make this yours.</p>
</div>
</div>
<div class="card cta">
<div class="body">
<div class="icon" aria-hidden="true">🌐</div>
<h3>Add a custom domain</h3>
<p>Point your own hostname at this app from the console.</p>
</div>
<a class="btn" href="https://console.clue2.app" target="_blank" rel="noopener">Open console →</a>
</div>
<div class="card cta">
<div class="body">
<div class="icon" aria-hidden="true">📊</div>
<h3>View build logs / metrics</h3>
<p>Watch builds, inspect runtime logs, track CCU usage.</p>
</div>
<a class="btn ghost" href="https://console.clue2.app" target="_blank" rel="noopener">Open console →</a>
</div>
</div>
</section>
<footer>
Clue2App — push code, get apps ·
<a href="https://clue2app.ai" target="_blank" rel="noopener">clue2app.ai</a>
</footer>
</main>
</body>
</html>
"""
@app.get('/', response_class=HTMLResponse)
def root():
return HTMLResponse(content=WELCOME_HTML, status_code=200)
@app.get('/api/v1/health')
def get():
return "OK"
@app.get('/api/v1/health/version')
def getVersion():
return '1.0.0'