Build backend for moble app


#1

Hi all, I’m building my mobile app for meteor backend, using ionic (cordova) and angular, and i want to connect to my meteor app, with auth, with ddp, and so like. I search very simple lib for this, Asteroid.

Firstly i create simple nodejs application to test it. I can auth to my meteor backend, and get collections, but i cannot do any operations with my collection, like insert, delete, etc.
my nodejs code:

var Asteroid = require('asteroid')

var meteor = new Asteroid('localhost:3000');

meteor.loginWithPassword('vm@email.club', '111111').then(function(result){

  console.log(result) // return real ID meteor user

  //console.log(meteor.resumeLoginPromise)

  meteor.subscribe('users').ready.then(function () {
    var tasks = meteor.getCollection('users')

    console.log(tasks)
  });

}, function(error){
  console.log(error)
})

in console i see

userId: 'TXKxKLBBnJcDuFfF2',
loggedIn: true

but

resumeLoginPromise: { state: 'rejected', reason: [Error: No login token] },

any help please :smile:


#2

Maybe using http://angular-meteor.com/ is easier. This way you would also use the Meteor Cordova integration and the Meteor build tool for you whole app.