Skip to content

Instantly share code, notes, and snippets.

@imolein
Last active February 22, 2019 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imolein/1e99db00ffdde390bddac2273396398d to your computer and use it in GitHub Desktop.
Save imolein/1e99db00ffdde390bddac2273396398d to your computer and use it in GitHub Desktop.
Test receiver for andoid gps logger
local pegasus = require('pegasus')
local server = pegasus:new({
port = '9999'
})
server:start(function(req, resp)
local method = req:method()
local path = req:path()
local query = req:params()
if method == 'GET' and path == '/log' then
io.write(('Long: %s | Lat: %s | Speed: %s\n\n'):format(query.lat, query.long, tostring(query.s)))
end
resp:statusCode(200)
:write()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment