mirror of
https://github.com/status-im/codimd.git
synced 2025-01-12 23:44:15 +00:00
ts: lib/middleware/redirectWithoutTrailingSlashes.js
Signed-off-by: Raccoon <raccoon@hackmd.io>
This commit is contained in:
parent
68439de268
commit
cf630ede21
@ -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)
|
Loading…
x
Reference in New Issue
Block a user