text: var express = require('express');
  var path = require('path');
  var cookieParser = require('cookie-parser');
  var logger = require('morgan');
  const cors = require('cors');
  
  var indexRouter = require('./routes/index');
  
  const apiRouter = require('./routes/api');
  const { connect } = require('./config/database');
  
  connect();
  
  var app = express();
  
  app.use(cors());
  
  app.use(logger('dev'));
  app.use('/uploads', express.static('uploads'));
  app.use(express.json());
  app.use(express.urlencoded({ extended: false }));
  app.use(cookieParser());
  
  app.use(express.static(path.join(__dirname, 'public')));
  
  
  app.use('/', indexRouter);
  app.use('/api', apiRouter);
  module.exports = app;
  