From 619be6783fd4d2e4885a043b751604fc0fadb5ee Mon Sep 17 00:00:00 2001 From: Oliver Zhang Date: Mon, 22 Jan 2024 11:48:29 -0500 Subject: [PATCH] Fixed errors in fib.ts and fibRoute.ts --- src/fib.ts | 2 +- src/fibRoute.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fib.ts b/src/fib.ts index 0d292e9..56e8d40 100644 --- a/src/fib.ts +++ b/src/fib.ts @@ -1,5 +1,5 @@ // util function that computes the fibonacci numbers -export default function fibonacci(n) { +export default function fibonacci(n: number): number { if (n < 0) { return -1; } else if (n == 0) { diff --git a/src/fibRoute.ts b/src/fibRoute.ts index e4fa96e..e8df01e 100644 --- a/src/fibRoute.ts +++ b/src/fibRoute.ts @@ -1,8 +1,9 @@ // Endpoint for querying the fibonacci numbers import fibonacci from "./fib"; +import {Request, Response} from "express"; -export default (req, res) => { +export default (req : Request, res : Response) => { const { num } = req.params; const fibN = fibonacci(parseInt(num));