Skip to content

I want to add backend module written node.js, How do I do? #71

@AntonioCatanese

Description

@AntonioCatanese

Thank you for offering this useful source.
I am new in Angular JS full.
I want to show real time cryptocurrency data updating every 5 seconds, where do I add the back-end file or code?
Now there is 2 files to be connected.


callAPI.js

var IR = require('./backend/index');
var publicClient = new IR();
// get ticker for BTC-USD
publicClient.getMarketSummary("Xbt", "Usd", console.log);



myAPIs.js

var util = require('../node_modules/util'),
_ = require('../node_modules/underscore'),
request = require('../node_modules/request'),
//crypto = require('../node_modules/crypto'),
cheerio = require('../node_modules/cheerio'),
VError = require('../node_modules/verror');
IndependentReserve.prototype.getMarketSummary = function getMarketSummary(primaryCurrencyCode, secondaryCurrencyCode, callback)
{
this.getRequest('getMarketSummary', callback, {
primaryCurrencyCode: primaryCurrencyCode,
secondaryCurrencyCode: secondaryCurrencyCode}
);
//Get data from the exchange's offical API. 'https://api.independentreserve.com'
};

After all my questions are following :

  1. Where do I add callAPI.js or its contents?
    Do I need to something to gruntfile.js?

  2. How do I connect the result data to view controller?

  3. How do I implement auto data refresh every 5 seconds?

Regards.
Antonio.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions