Update server.js

This commit is contained in:
Ben Elferink
2020-12-31 03:48:12 +02:00
committed by GitHub
parent a205f496c9
commit 2b1c80743a

View File

@@ -27,8 +27,8 @@ mongoose.connect(CONNECTION_URL, DEPRECATED_FIX).catch((error) => console.log('
mongoose.connection.on('connected', () => console.log('✅ MongoDB connected')); mongoose.connection.on('connected', () => console.log('✅ MongoDB connected'));
mongoose.connection.on('error', (error) => console.log('❌ MongoDB:', error)); // listen for errors after the connection is established (errors during the session) mongoose.connection.on('error', (error) => console.log('❌ MongoDB:', error)); // listen for errors after the connection is established (errors during the session)
mongoose.connection.on('disconnected', () => console.log('❌ MongoDB disconnected')); mongoose.connection.on('disconnected', () => console.log('❌ MongoDB disconnected'));
// mongoose.set('useCreateIndex', true); mongoose.set('useCreateIndex', true);
// ^ ^ ^ uncomment this if you use the "unique: true" property in a Schema // ^ ^ ^ fix to a deprecated warning
// routes // routes
app.get('/', (req, res) => res.send('Hello World - Express.js')); app.get('/', (req, res) => res.send('Hello World - Express.js'));