diff --git a/src/config/index.js b/src/config/index.js deleted file mode 100644 index aef1de3..0000000 --- a/src/config/index.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - app : { - port: process.env.PORT || 3000, - }, -}; \ No newline at end of file diff --git a/src/index.js b/src/index.js index 49c4596..749ce3d 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,3 @@ -require('dotenv').config(); -const config = require('./config') const express = require('express'); const app = express(); const morgan = require('morgan'); @@ -37,6 +35,7 @@ app.use('/comment',commentRoutes); app.use('/auth',authRoutes); // starting the server +app.set('port', process.env.PORT || 3000); app.listen(app.get('port'), () => { console.log(`Server on port ${app.get('port')}`); });