From e9f3d0d0c314cb3101cb31eb0c649317acc045c8 Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Thu, 15 Jun 2017 15:53:55 +0200 Subject: [PATCH] Refactor api, relocate routes and clean up the code --- lib/web/index.js | 2 +- lib/web/middleware.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/web/index.js b/lib/web/index.js index 3c32f1dd7..2f189592e 100644 --- a/lib/web/index.js +++ b/lib/web/index.js @@ -1,9 +1,9 @@ 'use strict'; const async = require('async'); -const escape = require('js-string-escape'); const bodyParser = require('body-parser'); const Cookies = require('cookies'); +const escape = require('js-string-escape'); const express = require('express'); const fs = require('fs'); const Handlebars = require('handlebars'); diff --git a/lib/web/middleware.js b/lib/web/middleware.js index 08ece6eb3..80bb1649a 100644 --- a/lib/web/middleware.js +++ b/lib/web/middleware.js @@ -8,6 +8,7 @@ const createError = require('http-errors'); const utils = require('../utils'); const Logger = require('../logger'); + module.exports.match = function match(regexp) { return function(req, res, next, value) { if (regexp.exec(value)) {