console-express-routes
v1.0.2
Published
As follows, output logs the routes registered with the Express.
Downloads
191
Maintainers
Readme
console-express-routes
As follows, output logs the routes registered with the Express.
Installation
npm
$ npm install console-express-routes
yarn
$ yarn add console-express-routes
Usage
TypeScript
import express from 'express';
import consoleExpressRoutes from 'console-express-routes';
const app = express();
app.get('/', (req: Request, res: Response) => {
...
});
...
app.listen(3000, () => {
console.log('Example app listening on port 3000!');
consoleExpressRoutes(app);
});
JavaScript
ES Module
import express from 'express';
import consoleExpressRoutes from 'console-express-routes';
const app = express();
app.get('/', (req, res) => {
...
});
...
app.listen(3000, () => {
console.log('Example app listening on port 3000!');
consoleExpressRoutes(app);
});
CommonJS
Note that you should be require('...').default
.
const express = require('express');
const consoleExpressRoutes = require('console-express-routes').default;
const app = express();
app.get('/', (req, res) => {
...
});
...
app.listen(3000, () => {
console.log('Example app listening on port 3000!');
consoleExpressRoutes(app);
});