How to use the express-promise-router.Router function in express-promise-router

To help you get started, we’ve selected a few express-promise-router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Jacwutang / CryptoEngineX / routes / index.js View on Github external
const router = require("express-promise-router").Router();

const db = require("../db");

// GET home page
router.get("/", (req, res) => {
  res.send("Home");
});

module.exports = router;
github Jacwutang / CryptoEngineX / routes / users.js View on Github external
const router = require("express-promise-router").Router();

const db = require("../db");

//Load in controllers
const user_controller = require("../controllers/userController");

router.get("/", user_controller.user_list);

module.exports = router;

express-promise-router

A lightweight wrapper for Express 4's Router that allows middleware to return promises

MIT
Latest version published 3 years ago

Package Health Score

64 / 100
Full package analysis

Popular express-promise-router functions