Meteor Auth in Express

Hi there,

I’m currently scoping out what the best platform for my company to use is and we have a couple of things I can’t either find a solution to or find an example of in Meteor. We have an existing mobile application that will not be re-written but we are looking to build out our backend with additional features and Meteor seems to nail most of them. Apollo isn’t “out of the picture” but our mobile devs have much more experience in working with RESTful APIs so we are trying to find a solution that offers realtime in the browser, but can handle a RESTful API.

I’ve used Meteor before and it seems like a good fit. I’m happy to see it’s now easier to integrate an Express app into it, but I’m curious if it’s possible to get Meteor’s auth to work with the RESTful API? I’ve played with it a bit but I don’t see a solid solution. I’m hoping to stay away from packages like Picker simply because Meteor as a whole if looking to move away from Atmosphere, but also the Express community is much larger and offers more potential value.

My main question is, is there an example someone can point me at where someone has created an authed RESTful API with Meteor and Express? Second, if there is no example, is it just impossible?

1 Like

Take a look at simple:rest-accounts-password for inspiration.

The underlying simple:json-routes package essentially uses meteor’s underlying http server (connect).

Connect and express have very similar apis, so you can reuse most of the source code from these packages.

Check out the rest of the packages for even more inspiration.

1 Like

Ah, thanks for pointing that out. Maybe this package is a decent answer to my needs, but I’m still wary of using an Atmosphere package not actively maintained by MDG as there’s no guarantee it’ll get moved to NPM eventually. Maybe that’s too much worry though?

1 Like

You don’t need to use the package. Take a peek at the sources for the relevant packages and you’ll immediately realize meteor is in essence a connect app :slight_smile:

From that point on, you can implement those parts that you need from scratch, probably copy and pasting most of the source from those packages, which kind of don’t need any maintenance unless there happens to be a drastic api change on connect, accounts, meteor etc.

1 Like

Hm, fair enough. Thanks!

1 Like

@firrae, what route did you end up taking?

I’m looking to do something similar here.