Install morgan to print logs of connections

This commit is contained in:
2020-04-03 01:47:58 +08:00
parent 7ca9bb247b
commit c34c7a9c5a
3 changed files with 44 additions and 0 deletions

View File

@ -1,9 +1,11 @@
import express from 'express';
import morgan from "morgan";
import { getLocationOfTarget } from './app.service';
const port = Number(process.env.PORT) || 3000;
const app = express();
app.use(morgan('common'))
app.get('/*', async (req, res) => {
const target = req.url.slice(1);