import dotenv from 'dotenv';
import './CreateRSAKeyFile';
import models from './models';
import app from './server';

dotenv.config();
dotenv.config({ path: `${__dirname}/key/rsapair.pem` });
const env = process.env.NODE_ENV || 'development';
const port = process.env.PORT || 8080;
if (env === 'development') {
  models.sequelize.sync({ force: true })
  .then(() => {
    app.listen(port, () => {
      //eslint-disable-next-line
      console.log(`Server started on ${port}`);
    });
  });
} else {
  app.listen(port, () => {
    //eslint-disable-next-line
    console.log(`Server started on ${port}`);
  });
}

export default app;

@@ -55,39 +55,8 @@
 e';%0A
-import models from './models';%0A
 impo
@@ -164,182 +164,42 @@
 nst 
-env = process.env.NODE_ENV %7C%7C 'development';%0Aconst port = process.env.PORT %7C%7C 8080;%0Aif (env === 'development') %7B%0A  models.sequelize.sync(%7B force: true %7D)%0A  .then(() =%3E %7B%0A    
+port = process.env.PORT %7C%7C 8080;%0A%0A
 app.
@@ -219,20 +219,16 @@
 () =%3E %7B%0A
-    
   //esli
@@ -248,20 +248,16 @@
 xt-line%0A
-    
   consol
@@ -296,142 +296,11 @@
 %60);%0A
-    %7D);%0A  %7D);%0A%7D else %7B%0A  app.listen(port, () =%3E %7B%0A    //eslint-disable-next-line%0A    console.log(%60Server started on $%7Bport%7D%60);%0A  %7D);%0A%7D
+%7D);
 %0A%0Aex

remove sequelize sync; use migrations