import express from 'express';
import logger from 'morgan';
import bodyParser from 'body-parser';
import path from 'path';
import route from './server/routes/index';
import db from './server/models/';

// Set up the express app
const app = express();
const port = process.env.PORT || 3000;

// Log requests to the console.
app.use(logger('dev'));

// Parse incoming requests data (https://github.com/expressjs/body-parser)
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

// load the client side
app.use(express.static(path.join(__dirname, './client/public/')));

// Require our routes into the application.
route(app);
// Setup a default catch-all route that sends back a welcome message in JSON.
app.get('*', (req, res) => res.status(200).send({
  message: 'Welcome to doc-mgt',
}));

app.listen(port, () => {
  console.log(`Express is up on port ${port}`);
});
export default app;

// db.sequelize.sync().done(() => {
//   app.listen(port, () => {
//     console.log(`Express is up on port ${port}`);
//   });
// });
@@ -813,16 +813,19 @@
 ,%0A%7D));%0A%0A
+// 
 app.list
@@ -841,16 +841,19 @@
 () =%3E %7B%0A
+// 
   consol
@@ -896,36 +896,15 @@
 %60);%0A
+// 
 %7D);%0A
-export default app;%0A%0A// 
 db.s
@@ -932,19 +932,16 @@
 () =%3E %7B%0A
-// 
   app.li
@@ -959,19 +959,16 @@
 () =%3E %7B%0A
-// 
     cons
@@ -1013,19 +1013,35 @@
 %60);%0A
-// 
   %7D);%0A
-// 
 %7D);
+%0Aexport default app;%0A%0A

improve ui