1

I'm using Context.io's Node.js client library to get the body of emails from my account which is done in my code below.

Once I have that data, I am confused as to how I would get them over to the front-end. I'm new to the whole MEAN stack, and from my research of the basics, I have gathered that with Node, you can make the http calls, parse the json response and then write it to the server, but it seems as if I would have to make an API to then be able to call it from Angular and display it how I wish. I know that with other back-end languages like PHP, you can just write the code within the html, and not need a middle structure to get the info from PHP to the front-end. Is there an easier way than writing my own API in Node after having already made an API request to Context.io?

ctxioClient.accounts(ID).messages().get({limit:10}, function ( err, response) {
    if(err) throw err;

    console.log("getting responses...");
    var messages = response.body;

    console.log("message id is " );
    console.log(messages.body);
Rafa
  • 3,219
  • 4
  • 38
  • 70

1 Answers1

1

You should implement the backend in JSON using something like res.json and make AJAX requests via Angular $http or something similar.

Ian Macalinao
  • 1,608
  • 3
  • 20
  • 30