Added basic logging output for debugging locally

This commit is contained in:
Gregory Campbell
2021-11-23 22:47:32 -05:00
parent 0786eeb492
commit 467c75b55a
3 changed files with 65 additions and 0 deletions
+2
View File
@@ -5,6 +5,7 @@ const routes = require('./routes/msg'); //import the routes
const mongoose = require('mongoose'); //import mongoose
const helmet = require('helmet'); //import helmet
const compression = require('compression'); //import compression
const morgan = require('morgan') //import morgan
const app = express();
app.use(helmet());
@@ -19,6 +20,7 @@ mongoose.connect(
);
app.use(express.json()); //parses incoming requests with JSON payloads
app.use(morgan('combined')) //prints logging when requests are made
app.use('/', routes); //to use the routes