Skip to content

Commit fe6c79e

Browse files
committed
update readme
1 parent f96b3b3 commit fe6c79e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,11 @@ const example = require('./routes/example');
4444
app.use('/', example);
4545

4646
//The routeCheck middleware config option
47-
//The path refers to the custom route you want to redirect the requests to
48-
const option = {
49-
path: '/PnF',
50-
};
47+
//The redirectPath refers to the custom route you want to redirect the requests to
48+
const options = { redirectPath: '/PnF' };
5149

5250
//It's important to use the routeCheck middleware after all routes are loaded
53-
app.use(routeCheck(app, option));
51+
app.use(routeCheck(app, options));
5452

5553
//Start the server
5654
app.listen(5003);

test/server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ app.post('/', (req, res) => {
4848
});
4949
});
5050

51+
const options = { redirectPath: '/PnF', };
52+
5153
//The routeCheck middleware
52-
app.use(routeCheck(app, { redirectPath: '/PnF', }));
54+
app.use(routeCheck(app, options));
5355

5456

5557
const server = app.listen(PORT);

0 commit comments

Comments
 (0)