From 77ffde450e92ffe6527c35ffc2383b17d4c04f68 Mon Sep 17 00:00:00 2001 From: braxtonhall Date: Sun, 23 Oct 2022 12:27:49 -0700 Subject: Rename directory to use GitHub ID --- entries/braxtonh/express/index.js | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 entries/braxtonh/express/index.js (limited to 'entries/braxtonh/express') diff --git a/entries/braxtonh/express/index.js b/entries/braxtonh/express/index.js deleted file mode 100644 index 2da6092..0000000 --- a/entries/braxtonh/express/index.js +++ /dev/null @@ -1,22 +0,0 @@ -import { get } from "axios"; -import express from "express"; - -const app = express(); - -const getURL = (n) => `/fib?${new URLSearchParams({n})}`; - -app.get("/fib", async (res, req, next) => { - const {n} = req.params; - if (n <= 0) { - res.send(n).status(200); - } else { - const futures = [get(getURL(n - 1)), get(getURL(n - 2))]; - const [nSub1, nSub2] = await Promise.all(futures); - res.send(nSub1 + nSub2).status(200); - } - return next(); -}); - -app.start(); - -// TODO... is this syntax correct??? -- cgit v1.2.3-70-g09d2