express-routes-list
v0.0.1
Published
Confirm routing on the terminal.
Downloads
3
Readme
express-routes-list
Confirm routing on the terminal.
Install
$ npm install express-routes-list --save-dev
Usage
'use strict';
const express = require('express');
const app = express();
const routesList = require('express-routes-list');
app.get('/', (req, res) => {
res.send('Hello World');
});
app.post('/', (req, res) => {
res.send('Hello World');
});
app.post('/test', (req, res) => {
res.send('Test');
});
app.post('/test/:id', (req, res) => {
res.send('Test');
});
// add
if (process.env.NODE_ENV === 'development') {
routesList(app);
}
app.listen(3000);
$ npm start
# you should write to package.json as a npm script
# "express-routes-list": "express-routes-list"
$ express-routes-list
- run your express application
- run express-routes-list