fix: various issues arising from oak removal (#23)

This commit is contained in:
Luca Casonato
2021-06-05 19:44:15 +02:00
committed by GitHub
parent a48da64dc3
commit 9eea430c1e
6 changed files with 19 additions and 19 deletions
-1
View File
@@ -1 +0,0 @@
export * from "../server.ts";
+3 -4
View File
@@ -1,5 +1,3 @@
import { oak } from "../../api_deps.ts";
// Jokes courtesy of https://punsandoneliners.com/randomness/programmer-jokes/
const JOKES = [
"Why do Java developers often wear glasses? They can’t C#.",
@@ -14,7 +12,8 @@ const JOKES = [
"An SEO expert walked into a bar, pub, inn, tavern, hostelry, public house.",
];
export default (ctx: oak.Context) => {
export default (_req: Request): Response => {
const randomIndex = Math.floor(Math.random() * 10);
ctx.response.body = JOKES[randomIndex];
const body = JOKES[randomIndex];
return new Response(body);
};