more info comments

This commit is contained in:
Ben Elferink
2020-12-26 15:59:49 +02:00
parent b31db021cb
commit a2000e302a

View File

@@ -1,7 +1,7 @@
import mongoose from 'mongoose'; import mongoose from 'mongoose'; // MongoDB (database)
import express from 'express'; import express from 'express'; // Backend App (server)
import dotenv from 'dotenv'; import dotenv from 'dotenv'; // Secures content
import cors from 'cors'; import cors from 'cors'; // HTTP headers
// import IMPORTED_ROUTES from './routes/route.js'; // import IMPORTED_ROUTES from './routes/route.js';
// ^ ^ ^ un-comment this to use imported route(s) // ^ ^ ^ un-comment this to use imported route(s)
// doing this will link the following files: index.js -> route.js -> controller.js -> model.js // doing this will link the following files: index.js -> route.js -> controller.js -> model.js
@@ -30,7 +30,7 @@ mongoose
.catch((error) => console.log(`❌ MongoDB: ${error}`)); // similiar to - mongoose.connection.on('error') .catch((error) => console.log(`❌ MongoDB: ${error}`)); // similiar to - mongoose.connection.on('error')
// mongoose.set('useCreateIndex', true); // mongoose.set('useCreateIndex', true);
// ^ ^ ^ uncomment this if you use the "unique: true" property in a model Schema // ^ ^ ^ uncomment this if you use the "unique: true" property in a Schema
// routes // routes
app.get('/example', (req, res) => res.send('Hello World - Express.js')); app.get('/example', (req, res) => res.send('Hello World - Express.js'));