Last active
February 22, 2019 16:45
-
-
Save imolein/1e99db00ffdde390bddac2273396398d to your computer and use it in GitHub Desktop.
Test receiver for andoid gps logger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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