Skip to content

Setup webserver image stream

Thomas T. Jarløv edited this page Aug 8, 2018 · 2 revisions

If you have a device with multiple cameras, Jester can help you serve static images in combination with e.g. fswebcam.

This can be used with NimHA's Filestream module.

Example

import jester
import osproc

routes:
  get "/":
    resp("Nothing here")

  get "/stairs/@key":
    if @"key" != "secret":
      resp("")
    
    discard execCmd("fswebcam -d /dev/video0 private/stairs.jpeg")
    sendFile("private/stairs.jpeg")

  get "/hallway/@key":
    if @"key" != "secret":
      resp("")
    
    discard execCmd("fswebcam -d /dev/video1 private/hallway.jpeg")
    sendFile("private/hallway.jpeg")