Skip to content

Commit

Permalink
Merge pull request #18 from ilija139/master
Browse files Browse the repository at this point in the history
Add configure() function to simplify setting the server URL.
  • Loading branch information
szym committed Feb 20, 2016
2 parents 17e6a60 + 2dbd268 commit 4468f90
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ local function normalize(img, opts)
return img
end

-- Set the URL of the listening server
function M.configure(config)
local port = config.port or 8000
local hostname = config.hostname or '127.0.0.1'
M.url = 'http://' .. hostname .. ':' .. port ..'/events'
end

function M.image(img, opts)
-- options:
Expand Down

0 comments on commit 4468f90

Please sign in to comment.