forked from epesooj/webring
First version of webring with simple landing page and control functions.
This commit is contained in:
commit
554960fbef
22 changed files with 3621 additions and 0 deletions
8
functions/next.ts
Normal file
8
functions/next.ts
Normal file
|
@ -0,0 +1,8 @@
|
|||
import { next } from '../src/webring';
|
||||
|
||||
export const onRequestGet: PagesFunction = async (context) => {
|
||||
const id = new URL(context.request.url).searchParams.get('id') ?? 'main';
|
||||
const item = next(id);
|
||||
const url = item?.url ?? new URL(context.request.url).origin;
|
||||
return Response.redirect(url, 303);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue