Create unfinished getLocationOfTarget

This commit is contained in:
2020-04-02 01:37:06 +08:00
parent f720bcaa25
commit 5c6a2cc83b
2 changed files with 7 additions and 2 deletions

3
src/app.service.ts Normal file
View File

@ -0,0 +1,3 @@
export const getLocationOfTarget = (target: string) => {
return `Location of ${target}`;
};

View File

@ -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, () => {