Skip to content

Commit ebdd47e

Browse files
committed
[server] Add /healthz endpoint for Kubernetes, bring back GitHub stuff:
1 parent c526e7e commit ebdd47e

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@noel/site",
33
"description": "🐾 Noel's personal website, blog, and documentation site made with Astro",
4-
"version": "12.3.2",
4+
"version": "12.3.3",
55
"private": true,
66
"author": "Noel <[email protected]>",
77
"homepage": "https://floofy.dev",

server/server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ async function main() {
7474
root: resolve(DIST_PATH, 'client/_astro')
7575
});
7676

77+
server.get('/healthz', (_, reply) => reply.status(200).send('OK!'));
7778
server.all('*', async (req, reply) => {
7879
for (const [header, value] of Object.entries(reply.getHeaders())) reply.header(header, value);
7980

src/pages/index.astro

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@ import Page from '../components/Page.astro';
66
77
import '../styles/global.css';
88
9-
// const token = import.meta.env.GITHUB_TOKEN;
10-
// const githubRepos = await fetch('https://api.github.com/users/auguwu/repos', {
11-
// headers:
12-
// token !== undefined
13-
// ? {
14-
// Authorization: `token ${token}`
15-
// }
16-
// : {}
17-
// })
18-
// .then((res) => res.json())
19-
// .then((data: any[]) =>
20-
// data
21-
// .sort((a, b) => b.stargazers_count - a.stargazers_count)
22-
// .filter((s) => !s.archived)
23-
// .filter((s) => s.name !== 'auguwu')
24-
// .slice(0, 6)
25-
// );
9+
const token = import.meta.env.GITHUB_TOKEN;
10+
const githubRepos = await fetch('https://api.github.com/users/auguwu/repos', {
11+
headers:
12+
token !== undefined
13+
? {
14+
Authorization: `token ${token}`
15+
}
16+
: {}
17+
})
18+
.then((res) => res.json())
19+
.then((data: any[]) =>
20+
data
21+
.sort((a, b) => b.stargazers_count - a.stargazers_count)
22+
.filter((s) => !s.archived)
23+
.filter((s) => s.name !== 'auguwu')
24+
.slice(0, 6)
25+
);
2626
---
2727

2828
<Page
@@ -62,7 +62,7 @@ import '../styles/global.css';
6262
</a>
6363
</div>
6464

65-
<!-- <div class="flex container mx-auto mt-6 items-center justify-center lg:hidden">
65+
<div class="flex container mx-auto mt-6 items-center justify-center lg:hidden">
6666
<div class="grid grid-cols-1 gap-6 [&>*]:h-full">
6767
{githubRepos.map((data) => <ProjectCard data={data} />)}
6868
</div>
@@ -72,6 +72,6 @@ import '../styles/global.css';
7272
<div class="grid grid-cols-3 gap-3 items-center [&>*]:h-full">
7373
{githubRepos.map((data) => <ProjectCard data={data} />)}
7474
</div>
75-
</div> -->
75+
</div>
7676
</Container>
7777
</Page>

0 commit comments

Comments
 (0)