Building two models and figuring out structure

This commit is contained in:
Arjun Patel
2019-01-03 14:42:15 -08:00
parent aeedd20fa0
commit 5493c4cef7
5 changed files with 112 additions and 3 deletions
+13 -3
View File
@@ -2,8 +2,8 @@
const express = require('express'),
app = express(),
router = express.Router(),
port = process.env.PORT || 4200;
port = process.env.PORT || 4200,
sequelize = require('./sequelize.js');
//define a route, usually this would be a bunch of routes imported from another file
router.get('/', function (req, res, next) {
@@ -17,4 +17,14 @@ router.get('/', function (req, res, next) {
app.listen(port);
//log to console to let us know it's working
console.log('Ucharify API server started on: ' + port);
console.log('Ucharify API server started on: ' + port);
// //verify connection to db
// sequelize
// .authenticate()
// .then(() => {
// console.log('Connection has been established successfully.');
// })
// .catch(err => {
// console.error('Unable to connect to the database:', err);
// });