Skip to content

Commit

Permalink
Push (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
PuruVJ authored Dec 15, 2023
1 parent 84487bd commit a274167
Show file tree
Hide file tree
Showing 8 changed files with 552 additions and 25 deletions.
557 changes: 542 additions & 15 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions sites/hn.svelte.dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
"check": "svelte-check --tsconfig ./jsconfig.json"
},
"devDependencies": {
"@sveltejs/adapter-vercel": "^3.0.2",
"@sveltejs/kit": "^1.22.3",
"@sveltejs/adapter-vercel": "^4.0.0",
"@sveltejs/kit": "^2.0.0",
"prettier": "^2.7.1",
"prettier-plugin-svelte": "^2.10.1",
"svelte": "^4.0.5",
"vite": "^4.4.4"
"vite": "^5.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0"
},
"type": "module"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export async function load({ params, fetch }) {
return {
list: params.list,
page: +params.page,
items: fetch(`https://api.hnpwa.com/v0/${list}/${params.page}.json`).then((r) => r.json())
items: await fetch(`https://api.hnpwa.com/v0/${list}/${params.page}.json`).then((r) => r.json())
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ const render = (list, items) => `<?xml version="1.0" encoding="UTF-8" ?>

export async function GET({ params }) {
const list = params.list === 'top' ? 'news' : params.list === 'new' ? 'newest' : params.list;
const res = await fetch(`https://api.hnpwa.com/v0/${list}/1.json`);
const items = await res.json();
const items = await fetch(`https://api.hnpwa.com/v0/${list}/1.json`).then((r) => r.json());
const feed = render(list, items);

return new Response(feed, {
Expand Down
2 changes: 1 addition & 1 deletion sites/hn.svelte.dev/src/routes/item/[id]/+page.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export async function load({ params, fetch }) {
return fetch(`https://api.hnpwa.com/v0/item/${params.id}.json`).then((r) => r.json());
return await fetch(`https://api.hnpwa.com/v0/item/${params.id}.json`).then((r) => r.json());
}
2 changes: 1 addition & 1 deletion sites/hn.svelte.dev/src/routes/rss/+server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { dev } from '$app/environment';
import { redirect } from '@sveltejs/kit';

export function GET() {
throw redirect(dev ? 301 : 302, '/top/rss');
redirect(dev ? 301 : 302, '/top/rss');
}
2 changes: 1 addition & 1 deletion sites/hn.svelte.dev/src/routes/user/[name]/+page.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const csr = false;

export async function load({ params, fetch }) {
return fetch(`https://api.hnpwa.com/v0/user/${params.name}.json`).then((r) => r.json());
return await fetch(`https://api.hnpwa.com/v0/user/${params.name}.json`).then((r) => r.json());
}
File renamed without changes.

2 comments on commit a274167

@vercel
Copy link

@vercel vercel bot commented on a274167 Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

repl – ./packages/repl

svelte-rappel.vercel.app
repl-zeta.vercel.app
repl-git-master-svelte.vercel.app
repl-svelte.vercel.app

@vercel
Copy link

@vercel vercel bot commented on a274167 Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

hn – ./sites/hn.svelte.dev

hn-git-master-svelte.vercel.app
sites-zeta.vercel.app
hn-svelte.vercel.app
hn.svelte.dev

Please sign in to comment.