backend library now complete

This commit is contained in:
Ben Elferink
2020-12-27 01:27:52 +02:00
parent 96fcfceb88
commit 40e22e0392
4 changed files with 5 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ import mongoose from 'mongoose'; // MongoDB (database)
import express from 'express'; // Backend App (server)
import dotenv from 'dotenv'; // Secures content
import cors from 'cors'; // HTTP headers
// import IMPORTED_ROUTES from './routes/route.js';
// import IMPORTED_ROUTES from './api/routes/route.js';
// ^ ^ ^ un-comment this to use imported route(s)
// doing this will link the following files: index.js -> route.js -> controller.js -> model.js
@@ -31,8 +31,8 @@ mongoose.connection.on('disconnected', () => console.log('❌ MongoDB disconnect
// ^ ^ ^ uncomment this if you use the "unique: true" property in a Schema
// routes
app.get('/example', (req, res) => res.send('Hello World - Express.js'));
// app.use('/', IMPORTED_ROUTES);
app.get('/', (req, res) => res.send('Hello World - Express.js'));
// app.use('/api/v1/example', IMPORTED_ROUTES);
// ^ ^ ^ un-comment this to use imported route(s)
// server is listening for requests