forked from epesooj/webring
Move to Deno+Bunny.net, add a way to test webring locally.
This commit is contained in:
parent
9f66f0b37b
commit
8670aa3412
33 changed files with 599 additions and 3360 deletions
13
src/random.ts
Normal file
13
src/random.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { randomEntry } from './webring.ts';
|
||||
|
||||
export function redirectRandom(req: Request) {
|
||||
const url = randomEntry()?.url ?? new URL(req.url).origin;
|
||||
|
||||
return new Response('', {
|
||||
status: 303,
|
||||
headers: {
|
||||
location: url,
|
||||
'cache-control': 'no-cache, no-store, no-transform',
|
||||
},
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue