express-promise-patch
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

express-promise-patch

Monkey patches express application instance with promise aware implmenetation

const express = require("express");
const {patch: patchWithPromiseSupport} = require("express-promise-patch");

//const app = express();
const app = patchWithPromiseSupport(express());

app.get("*", function(req, res) {
    return Promise.resolve({
        id: 123,
        name: "Ori"
    }).then(obj => {
        throw new Error("Ooops");
    });
});

app.listen(3000, function() {
    console.log("Server is running");
});

Readme

Keywords

none

Package Sidebar

Install

npm i express-promise-patch

Weekly Downloads

0

Version

1.0.4

License

ISC

Last publish

Collaborators

  • oricalvo