1.0.4 • Published 6 years ago

express-promise-patch v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

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