szym / display

Lightweight browser-based display server
MIT License
212 stars 46 forks source link

Command line args not getting through #10

Closed lopsided closed 8 years ago

lopsided commented 8 years ago

I'm running this on a headless server so I ran the command like:

$ th -ldisplay.start 8888 0.0.0.0
server listening on http://127.0.0.1:8000

I spotted that in start.lua the first line is

local arg = {...}

Doesn't this wipe out the command line arguments? When I commented that line out it seems to work fine:

$ th -ldisplay.start 8888 0.0.0.0
server listening on http://0.0.0.0:8888
lopsided commented 8 years ago

Actually despite the cli showing the correct thing it still wasn't working. I also needed to change this line in init.lua:

M = {
  url = 'http://localhost:8000/events'
}

I just set this to what I needed manually, not sure how to get the cli args through to this script as I'm pretty new to lua.

szym commented 8 years ago

local arg = {...} snuck in there in an unrelated change. Fixed.

However, passing the parameters to th -ldisplay.start is just the server side. On the client you need to set the url. E.g.

disp = require 'display'
disp.url = 'http://mydisplayhost.org:8888/events'
disp.image(img)