This commit is contained in:
jslightham
2020-04-06 22:25:53 -04:00
parent 80539432e7
commit 9fd76cfed5
15 changed files with 1257 additions and 199 deletions

View File

@@ -5,8 +5,11 @@ const PORT = 4000;
const cors = require('cors');
const mongoose = require('mongoose');
const config = require('./DB.js');
const attendanceRoute = require('./attendance.route');
const loginRoute = require('./login.route');
mongoose.Promise = global.Promise;
mongoose.connect(config.DB, { useNewUrlParser: true }).then(
() => {console.log('Database is connected') },
@@ -18,6 +21,8 @@ app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());
app.use('/login', loginRoute);
app.use('/attendance', attendanceRoute);
app.listen(PORT, function(){
console.log('Server is running on Port:',PORT);