You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Understanding Promises....

Received Response
11
Views
2
Comments
edited Sep 29, 2017 7:00AM in Digital Assistant and Mobile 2 comments

Summary

Understanding Promises....

Content

Hi,

In my custom API i want to make multiple http calls in from one function. I wll be directly calling the http request and not using connectors.

I wanted to know how to use promise in such a case. Below is a snapshot of what i am trying to achieve

var express = require('express');

var bodyParser = require('body-parser');

var request = require("request");

var versionRoutes = require('express-routes-versioning')();

var app = express();

app.use(bodyParser.urlencoded({

   extended: false

}));

app.use(bodyParser.json());

module.exports = function (service) {

   service.use(function (req, res, next) {

   //req.version is used to determine the version

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!