normalize-path-express

1.0.0 • Public • Published

randomt hing i md efor my website makes pat h normal in express

express.static() may infinite redirect because express.static() adds "/" to the path for directories

✔ add { redirect: false } as an option to disabled this so it look like express.static(path, { redirect: false })

const normalize = require("normalize-path");
const express = require("express");

const app = express();
app.use(normalize);

app.get("/users/:id");
/*
Valid paths:
  //////users////296776625432035328///////
  /users/296776625432035328//////
*/

app.get("/param/another");
/*
Valid paths:
  /param/another/
  //////param//////another/////
*/

app.get("/");
/*
Valid paths:
  //////
  /
*/

app.listen(3000);

Readme

Keywords

none

Package Sidebar

Install

npm i normalize-path-express

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

1.27 kB

Total Files

3

Last publish

Collaborators

  • commandtechno