<commit_before>import logger from 'morgan';
import cookieParser from 'cookie-parser';
import bodyParser from 'body-parser';
import path from 'path';
import indexRouter from './routes/index';
import usersRouter from './routes/users';
import authRouter from './routes/authorization';
import errorHandle from './errorHandle';
import { passport, serializeLogin } from './auth/local';

export default function middleware(app, express) {
  // use body-parser to format request and attach it to req objects.
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(bodyParser.json());

  // define where express should look for static assests
  app.use(express.static(path.join(__dirname, '../public/dist/src')));

  // use passport for authentication
  app.use(passport.initialize());

  // pass the router files for each route
  app.use('/users', usersRouter);
  app.use('/auth', authRouter);
  app.use('/', indexRouter);

  // pass the logger
  app.use(logger('dev'));

  // 
  serializeLogin(passport);

  // pass the
  app.use(errorHandle.catchForward);
  app.use(errorHandle.handleError);
}<commit_msg>Remove lint errors in middleware config file.<commit_after>import logger from 'morgan';
import bodyParser from 'body-parser';
import path from 'path';
import indexRouter from './routes/index';
import usersRouter from './routes/users';
import authRouter from './routes/authorization';
import errorHandle from './errorHandle';
import { passport, serializeLogin } from './auth/local';

export default function middleware(app, express) {
  // use body-parser to format request and attach it to req objects.
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(bodyParser.json());

  // define where express should look for static assests
  app.use(express.static(path.join(__dirname, '../public/dist/src')));

  // use passport for authentication
  app.use(passport.initialize());

  // pass the router files for each route
  app.use('/users', usersRouter);
  app.use('/auth', authRouter);
  app.use('/', indexRouter);

  // pass the logger
  app.use(logger('dev'));

  serializeLogin(passport);

  // pass the
  app.use(errorHandle.catchForward);
  app.use(errorHandle.handleError);
}
{'fraction_non_alphanumeric': 0.14032697547683923, 'fraction_numerical': 0.0, 'mean_word_length': 4.386308068459658, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3683411', 'n_tokens_mistral': 631, 'n_tokens_neox': 618, 'n_words': 190}