0

Node JS require for the bittrex api... exactly where do it.

npm everything is installed including require...

var bittrex = require('bittrex-api');

on any page gives require is not defined

1) I'm using ui-router, server.js is not needed... I added one anyway.

 var express = require('express');
 var path = require('path');
 //var logger = require('morgan');
 //var cookieParser = require('cookie-parser');
 var bodyParser = require('body-parser');
 var mongoose = require('mongoose');
 //var bcrypt = require('bcryptjs');

 var app = express();

 app.set('port', process.env.PORT || 8080);
 //app.use(logger('dev'));
 app.use(bodyParser.json());
 app.use(bodyParser.urlencoded());
 //app.use(cookieParser());
 app.use(express.static(path.join(__dirname, '/')));

 app.listen(app.get('port'), function() {
 console.log('Express server listening on port ' + app.get('port'));
 });

now I want to add the bittrex ticker on the dashboard... so on the dashboard view I add

var market = 'BTC-LTC';
var bittrex = require('bittrex-api');

I turn on the server.js file and I get the require undefined message, I turn it off same message.

What am I doing wrong?

Radim Köhler
  • 122,561
  • 47
  • 239
  • 335
user2320607
  • 425
  • 1
  • 8
  • 19
  • Check also this, for more inspiration [AngularAMD + ui-router...](http://stackoverflow.com/q/27465289/1679310) – Radim Köhler Dec 17 '14 at 05:16
  • Did you try using something like [browserify](http://browserify.org/) to use node modules in the browser? – mscdex Dec 17 '14 at 05:23

0 Answers0