diff --git a/lib/middleware/redirectWithoutTrailingSlashes.js b/lib/middleware/redirectWithoutTrailingSlashes.ts similarity index 74% rename from lib/middleware/redirectWithoutTrailingSlashes.js rename to lib/middleware/redirectWithoutTrailingSlashes.ts index 456e3e30..6412e5d3 100644 --- a/lib/middleware/redirectWithoutTrailingSlashes.js +++ b/lib/middleware/redirectWithoutTrailingSlashes.ts @@ -1,8 +1,8 @@ -'use strict' +import {Request, Response} from "express"; -const config = require('../config') +import * as config from "../config"; -module.exports = function (req, res, next) { +export = function (req: Request, res: Response, next) { if (req.method === 'GET' && req.path.substr(-1) === '/' && req.path.length > 1) { const queryString = req.url.slice(req.path.length) const urlPath = req.path.slice(0, -1)