From b23aad5ecf5c12f0d173b617d18b8d51e562ba01 Mon Sep 17 00:00:00 2001 From: Mohd Shadmaan <124558510+shaad00@users.noreply.github.com> Date: Tue, 6 Jun 2023 14:07:06 +0530 Subject: [PATCH] Update 03-express-basics.js Remove unnecessary spaces and add a new method to initialize our PORT. --- 02-express-tutorial/final/03-express-basics.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/02-express-tutorial/final/03-express-basics.js b/02-express-tutorial/final/03-express-basics.js index 2e72fba46f..891a975a2e 100644 --- a/02-express-tutorial/final/03-express-basics.js +++ b/02-express-tutorial/final/03-express-basics.js @@ -1,5 +1,6 @@ const express = require('express') const app = express() +const PORT = 5000 app.get('/', (req, res) => { console.log('user hit the resource') @@ -14,8 +15,8 @@ app.all('*', (req, res) => { res.status(404).send('

resource not found

') }) -app.listen(5000, () => { - console.log('server is listening on port 5000...') +app.listen(PORT, () => { + console.log(`SERVER IS UP AND RUNNING ON PORT ${PORT}`) }) // app.get