'use strict';

if (process.env.NODE_ENV !== 'production') {
  require('dotenv').config({ silent: true });
}

const express = require('express');
const path = require('path');
const port = process.env.PORT || 8000;

const bodyParser = require('body-parser');
const cookieParser = require('cookie-parser');
const morgan = require('morgan');

const app = express();

const users = require('./routes/users');
const jobs = require('./routes/jobs');
const contacts = require('./routes/contacts');
const contacts_jobs = require('./routes/contacts_jobs');
const token = require('./routes/token');

app.disable('x-powered-by');

switch (app.get('env')) {
  case 'development':
    app.use(morgan('dev'));
    break;

  case 'production':
    app.use(morgan('short'));
    break;

  default:
}

app.use(bodyParser.json());
app.use(cookieParser());

app.use(express.static(path.join(__dirname, 'public')));

app.use(users);
app.use(jobs);
app.use(contacts);
app.use(contacts_jobs);
app.use(token);

app.use((_req, res) => {
  res.sendStatus(404);
});

// eslint-disable-next-line max-params
app.use((err, _req, res, _next) => {
  if (err.status || (err.output && err.output.statusCode)) {
    return res
      .status(err.status || err.output.statusCode)
      .send(err);
  }

  // eslint-disable-next-line no-console
  console.error(err.stack);
  res.sendStatus(500);
});

app.listen(port, () => {
  if (process.env.NODE_ENV !== 'test') {
    // eslint-disable-next-line no-console
    console.log('Listening on port', port);
  }
});

module.exports = app;

@@ -528,25 +528,25 @@
 tes/contacts
-_
+-
 jobs');%0Acons
@@ -886,24 +886,27 @@
 ublic')));%0A%0A
+// 
 app.use(user
@@ -905,24 +905,27 @@
 use(users);%0A
+// 
 app.use(jobs
@@ -923,24 +923,27 @@
 .use(jobs);%0A
+// 
 app.use(cont
@@ -945,24 +945,27 @@
 (contacts);%0A
+// 
 app.use(cont
@@ -976,16 +976,19 @@
 _jobs);%0A
+// 
 app.use(

Comment out app.use for unmade routes