cast-web-api in a snap

cast-web-api in a snap
Page content

After the sd card on my raspberry pi died the prospect of creating a new one so I could connect my google cast devices to smartthings did not sound like fun. Installing cast-web-api is not trivial. So, I decided this was a good opportunity to create my first snap.

Creating a snap to wrap a nodejs app was super easy. I shared my code on github, but this is the whole thing:

name: cast-web-api
version: '1.0.1'
summary: Control your Google Cast devices.
description: >
  See what's currently playing pause, play, set the volume and more, all from the SmartThings app. Quickly play your favorite content through presets.
  Check if the daemon is running:
    $ snap services cast-web-api
  restart:
    $ snap restart cast-web-api
    
grade: stable
confinement: strict

parts:
  cast-web-api:
    plugin: nodejs
    node-packages:
      - cast-web-api 
    source: .

apps:
  cast-web-api:
    command: cast-web-api
    daemon: simple
    plugs: [network, network-bind]

Now that the app is published in the store, I only need to run snap install cast-web-api to get the server running in port 3000. Moreover, once installed updates are automagic!.

Get it from the Snap Store