Batman.js with PhoneGap

Skip to first unread message


Aug 10, 2014, 12:08:21 AM8/10/14
Hey all,

I'm new to Batman.js and I'm really enjoying it!

I'm building an app that will have a Rails json api with Batman.js on the front end for the web app. But I also need an iOS app and I want to use Batman with Phonegap so I can reuse the code.

I know there is a proof of concept here:

... but I can't really understand how it was done. I can't get it to work.

Also, is it possible to use localhost:3000 to serve to the PhoneGap app with Batman (in development)?

Does anybody know of a good tutorial on how to get it going?

Thanks a lot. Will post here if I find a solution.

Robert Mosolgo

Aug 10, 2014, 3:06:39 PM8/10/14

I don't know PhoneGap at all, but I would be very interested in hearing your findings! It looks like the original was updated after that fork was created: 

It includes "lessons learned" and a link to post-build code.  

I noticed he used `` to build CoffeeScript & Sass. You might also check out gulp js for that. I wrote my experience with that combo:

It also includes a bit about "preloading" HTML by putting into a JS file. That way, batman.js won't have to lazy-load them.

Good luck and keep us posted if you end up checking it out!



You received this message because you are subscribed to the Google Groups "batman.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Aug 11, 2014, 12:45:28 AM8/11/14
Hey Robert,

Thanks a lot for the response. Will definitely check it out!

I will post my findings here, hopefully good ones.


Aug 12, 2014, 6:43:06 AM8/12/14
Hi Gabriel,

I'm the author of the batman-phonegap prototype project. It was a spike to see if it's a viable option to use Batman.js in a Phonegap project. At the moment we are developing a mobile app using this combo. Both Phonegap and Batman.js have their advantages and disadvantages, the most important is the lack of performance in Phonegap apps. But since you want to build an app for iOS, this will not be a big problem for you, since iOS devices have superior performance.

You are welcome to use the batman-phonegap project if you want, I haven't had time to see if the current state of the project runs OK, but I suspect it will. What you are probably missing is the Rails API part which the app runs on, you can find it in a seperate project:

You should run the Rails API on localhost:3000, to get it running you need to have basic knowledge of running a Rails app, it shouldn't be too difficult.

After that, use the instructions for the app to run on on localhost:8000. I haven't checked if both projects are in sync at the moment, but I'd be happy to help you out to get them running.

Kind regards,

Aug 12, 2014, 7:06:22 AM8/12/14
BTW instead of running a python server and using the, we are now using Middleman to run the app locally and compile all scss and coffeescript files:

You could probably use Brunch as well:
Reply all
Reply to author
0 new messages