Skip to content

Commit

Permalink
add strict test
Browse files Browse the repository at this point in the history
  • Loading branch information
dimdenGD committed Oct 31, 2024
1 parent 61150dd commit 56797df
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/tests/req/req-path-strict.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// must support req.path in strict routing

const express = require("express");

const app = express();
app.set('strict routing', true);

app.use("/test/", (req, res, next) => {
console.log(req.path);
next();
});

app.get("/test/", (req, res) => {
console.log(req.path);
res.send('test');
});

app.listen(13333, async () => {
console.log('Server is running on port 13333');

console.log(await fetch('http://localhost:13333/test/').then(res => res.text()));
process.exit(0);
});

0 comments on commit 56797df

Please sign in to comment.