Avatar

alexmcroberts

2 public vals
Joined January 27, 2023
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { getCards, getDivider, getHeader } from "https://esm.town/v/alexmcroberts/blocks";
// v1/cards
export default async function(req: Request): Promise<Response> {
const start = Date.now(); // Server-Timing
const header = getHeader();
const divider = getDivider();
const cards = await getCards();
const endCards = Date.now();
let out = {
blocks: [header, divider, cards],
};
const endBuildOut = Date.now(); // Server-Timing
const serverTimeString = "getcards;dur=" + (endCards - start).toString()
+ ", total;dur=" + (endBuildOut - start).toString();
return new Response(JSON.stringify(out), {
headers: {
"Server-Timing": serverTimeString,
},
});
}
1
2
3
4
5
6
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
// Github following
export let githubFollowing = fetchJSON(
"https://api.github.com/users/stevekrouse/following"
);
Next