From f1a52d3c907fe6e5f99d717c14ddde1f3b521575 Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Fri, 9 Sep 2022 15:14:51 +0200 Subject: [PATCH] Integrated the new link controller into the shortener server --- server/shortener.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/shortener.ts b/server/shortener.ts index 28e1b94..a25c47a 100644 --- a/server/shortener.ts +++ b/server/shortener.ts @@ -1,5 +1,5 @@ import express, {Express, Request, Response} from 'express'; -import {ShortenedLink} from "../models/ShortenedLink"; +import {getLinkObjectById} from "../controller/links"; const app: Express = express(); @@ -8,7 +8,7 @@ app.get("*", async (req: Request, res: Response) => { let redirect_url = "https://sheepstar.xyz"; // Search provided link - const found = await ShortenedLink.findOne({shortenedId: link}); + const found = await getLinkObjectById(link); if (found != null) { // Update redirect url redirect_url = found.originalUrl;