https://github.com/explosion-scratch/smart404
Make your error pages smart! Redirect users who made a typo automatically!
https://github.com/explosion-scratch/smart404
Last synced: 3 days ago
JSON representation
Make your error pages smart! Redirect users who made a typo automatically!
- Host: GitHub
- URL: https://github.com/explosion-scratch/smart404
- Owner: Explosion-Scratch
- License: bsd-3-clause
- Created: 2021-05-09T18:30:02.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-17T15:14:34.000Z (about 4 years ago)
- Last Synced: 2025-06-05T16:15:43.769Z (22 days ago)
- Language: JavaScript
- Homepage: https://npmjs.com/smart404
- Size: 6.84 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# smart404
Make your error pages smart! Redirect users who made a typo automatically!# Usage:
```js
const smart404 = require("smart404");
app.use(smart404(app, {
distance: .8, //80% or more similar to an actual route.
methods: ["GET"], //Methods to redirect
status: 302, //Status to send
ignoreRoutes: [], //Ignore these routes
}));//Must go BEFORE any other routes
```
It's that simple!