From 5c6a2cc83bcbfe434260320e0fca1674ad21affc Mon Sep 17 00:00:00 2001 From: Pin Lin Date: Thu, 2 Apr 2020 01:37:06 +0800 Subject: [PATCH] Create unfinished getLocationOfTarget --- src/app.service.ts | 3 +++ src/app.ts | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 src/app.service.ts diff --git a/src/app.service.ts b/src/app.service.ts new file mode 100644 index 0000000..2c250f3 --- /dev/null +++ b/src/app.service.ts @@ -0,0 +1,3 @@ +export const getLocationOfTarget = (target: string) => { + return `Location of ${target}`; +}; diff --git a/src/app.ts b/src/app.ts index d689060..3895f1b 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,11 +1,13 @@ import express from 'express'; +import { getLocationOfTarget } from './app.service'; let app = express(); app.get('/*', (req, res) => { - const target = req.url.slice(1) + const target = req.url.slice(1); - res.send(target) + const location = getLocationOfTarget(target); + res.send(location); }); app.listen(3000, () => {