text: 'use strict';
  
  // 3rd Party Resources
  const express = require('express');
  const cors = require('cors');
  const morgan = require('morgan');
  const v1=require('./routes/v1');
  const v2=require('./routes/v2');
  
  // Esoteric Resources
  const errorHandler = require('./error-handlers/500.js');
  const notFound = require('./error-handlers/404.js');
  const authRoutes = require('./routes/routes');
  
  // Prepare the express app
  const app = express();
  
  // App Level MW
  app.use(cors());
  app.use(morgan('dev'));
  
  app.use(express.json());
  app.use(express.urlencoded({ extended: true }));
  
  // Routes
  app.use(authRoutes);
  app.use('/api/v1',v1);
  app.use('/api/v2',v2);
  
  app.get('/test',(req,res)=>{
    res.send('hello osama');
  })
  
  const start = (port) => {
    app.listen(port, () => {
      console.log(`The server start running at port ${port}`);
    });
  };
  // Catchalls
  app.use(notFound);
  app.use(errorHandler);
  
  module.exports = {
    server: app,
    start: (port) => {
      app.listen(port, () => {
        console.log(`Server Up on ${port}`);
      });
    },
  };
  