3

Currently I'm working on IoT project, and we decided to use Beagle Bone Black. Original BBB OS use too much space and RAM so we googled and found Snappy Ubuntu Core as a perfect solution.

Problem is that I am new in Linux, and I find it hard to understand how snappy works, and where to start. This technology is relatively new, and I can't find tutorials, or books for absolute beginners.

So, I created NodeJs WebApp that runs on BBB for configuring and linking some inputs and outputs. Now I don't understand how to make snappy app of that, and run it on Snappy Ubuntu Core. I tried to write snapcraft.yaml file but I don't really understand what I need to put in the parts, or what parts really are. I just know everything can be a part :).

So, please can someone try to explain this to me like I'm a child, who grew up on Windows, and who knows NodeJS. I think it will be helpfull not only to me,but for many soon to be IoT developers.

Thank you

6
  • 1
    Have you looked here? Regarding nodejs specifically, Snapcraft has an example for it.
    – kyrofa
    Mar 11, 2016 at 14:25
  • Yes, I looked. For last 3 days I am reading documentation and watching examples but i cant connect it all in my head. Yes I have an example for it. But where is the original application. In this examples, every app is 5 lines long. I have a few node_modules in my project. So does expressJs need to be snap by itself, does body-parser need to be snap. Or I can encapsulate my whole project in one snap. Sry but I am really new xD Mar 11, 2016 at 14:41
  • Actually, the example is simple, but a good starting point. You should have a package.json file in your project and snapcraft will automatically use that to resolve dependencies if you use the nodejs plugin.
    – didrocks
    Mar 11, 2016 at 15:38
  • Thank you. You helped me with that example and I managed to build .snap package and install it. Now my problem is that application doesn't work. I think it is because of some missing dependency. Is there any way to check if it's going to work before installing it or building .snap package. I just want to see is everything ok with paths and dependencies. Mar 14, 2016 at 13:53
  • Try installing the snappy-debug snap and use snappy-debug.security scanlog to find out what might be missing. There's also askubuntu.com/questions/784489/… to set up / debug a service.
    – dholbach
    Jun 14, 2016 at 8:21

1 Answer 1

2

I'm picking up the replies in the comments to the question here.

snapcraft has a nodejs plugin which makes bundling very easy. You can pass node-packages which are then bundled with the app, using the standard package.json file will work too.

You can also specify node-engine which will define the version of nodejs you want the snap to run on.

A simple example of this can be found in the snapcraft code. Another one using grunt can be found in the snappy playpen.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .