https://github.com/derrickpelletier/express-route-log
Logs express routes to console
https://github.com/derrickpelletier/express-route-log
Last synced: 24 days ago
JSON representation
Logs express routes to console
- Host: GitHub
- URL: https://github.com/derrickpelletier/express-route-log
- Owner: derrickpelletier
- License: mit
- Created: 2016-08-27T19:47:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-08-29T05:41:53.000Z (over 8 years ago)
- Last Synced: 2025-03-20T00:15:35.804Z (about 1 month ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Express route log
`npm install express-route-log`
Use to log your Express.js app routes. Nice in a dev environment, just for sanity check or whatever.
Have had the script kicking around for a while in a few projects so just getting it out there.
Supports standard route structures, nested routers, etc. Just require it in after your routes have been defined.
Optional second param is a function to use in place of `console.log`.
## Usage
```javascript
const express = require('express');
const app = express();app.get('/', (req, res, next) => {
//...
});app.get('/pageOne', (req, res, next) => {
//...
});app.post('/pageTwo', (req, res, next) => {
//...
});require('express-route-log')(app);
// prints out the following:
/*
Routes:
GET /
GET /pageOne
POST /pageTwo
*/
```## Example output
