const PORT = process.env.PORT || 5000;
mongoose.connect(CONNECTION_URL, { useNewUrlParser: true, useUnifiedTopology:true })
.then(() => app.listen(PORT, () => console.log('Server running on port: ${PORT}')))
.catch((error) => console.log(error.message));
mongoose.set('useFindAndModify', false);
Output:
Server running on port: ${PORT}
The server is running on PORT
but the syntax you used to console.log
is called Template literals.
So it will be `(backtick) instead of '
(quote).
.then(() => app.listen(PORT, () => console.log(`Server running on port: ${PORT}`)))