Again, JS server superstar Justin d’Archangelo wrote an implementation of a web server that works on Firefox OS. It’s called fxos-web-server and it includes a few examples you can run.
None of the examples particularly fit my use case–I want to serve static content from a phone to other phones, but the examples were a bit more contrived. So I decided to build a simpler proof-of-concept example: catserver, a web server that served a simple page with full screen Animated GIFs of cats:
Now it also has a command line tool, and you can push and launch apps from the command line without even having to write a custom script that uses the module (of course, you can still use the module code by requiring it).
I’m doing some research and playing with this new-ish API which is available in Firefox OS on rooted phones with Certified apps etc etc. Guillaume wrote a post on the Hacks blog–read it if you’re interested in what can be accomplished.
The very first thing you need to do is to enable Wi-Fi direct on the device. This involves running some commands as root, via adb. Justin made a gist which worked with Flame phones, but it didn’t work with a Nexus 4, because of the way the /system partition is mounted on those phones.
Well, that’s funny–I finish writing a few modules for (potentially) node-firefox and then on the same day I discover the recording for my FOSDEM talk on node-firefox is online!
It’s probably not the best recording you’ve ever seen, as it is not recording the output of my laptop, but here are the slides too if you want to see my fabulously curated GIFs (and you know you want to). Here’s also the source of the slides, and the article for Mozilla Hacks that presents node-firefox and which might probably help you more than watching the video with the slides.
If you’re interested in watching the other Mozilla talks at FOSDEM they’re here.