Looking for some guidance as a beginner trying to create and run a nodejs application.
Encountering an error while running server.js via nodemon, the console displays the following:
Express server listening on port 3000
Mongoose default connection open to mongodb://localhost:27017/foo
GET / 302 18.313 ms - 62
GET / 302 3.115 ms - 62
GET / 302 1.537 ms - 62
GET / 302 1.480 ms - 62
GET / 302 2.280 ms - 62
GET / 302 0.830 ms - 62
GET / 302 0.835 ms - 62
GET / 302 0.895 ms - 62
This is my server.js code snippet:
var path = require('path');
var bodyParser = require('body-parser');
...
});
Below is the content of my config.js file:
module.exports = {
// App Settings
MONGO_URI: process.env.MONGO_URI || 'mongodb://localhost:27017/foo',
TOKEN_SECRET: process.env.TOKEN_SECRET || 'YOUR_UNIQUE_JWT_TOKEN_SECRET'
}