yutak23 / console-express-routes

Output logs the routes registered with the Express.

Home Page:https://www.npmjs.com/package/console-express-routes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

console-express-routes test

As follows, output logs the routes registered with the Express.

img

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);
});

License

MIT licensed

About

Output logs the routes registered with the Express.

https://www.npmjs.com/package/console-express-routes

License:MIT License


Languages

Language:JavaScript 100.0%