text: import express from 'express';
  import cors from 'cors';
  import 'dotenv/config';
  import helmet from 'helmet';
  import path from 'path';
  import cookieParser from 'cookie-parser';
  import logger from 'morgan';
  
  import routes from './routes';
  
  const app = express();
  
  const whitelist = ['http://localhost:3000']
  const corsOptions = {
    origin: whitelist,
    optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204
  }
  
  app.use(cors(corsOptions));
  app.use(helmet());
  app.use(logger('dev'));
  app.use(express.json());
  app.use(express.urlencoded({ extended: false }));
  app.use(cookieParser());
  app.use(express.static(path.join(__dirname, '../public')));
  
  routes(app);
  
  export default app;
  