A simple Node server & web app with SQLite database for field-testing & analysis of the Background Geolocation plugin.
You must have npm installed on your computer. From the root project directory run these commands from the command line:
npm install
This will install all dependencies.
To build the project, first run this command:
npm start
This will perform an initial build of the Javascript and boot the web-server on port 8080
Now visit http://localhost:8080
You can deploy easily the app on Heroku by pushing the code to your heroku git repository.
Before this, you will need to create 2 environment variables :
NPM_CONFIG_PRODUCTION = false
: It will tell heroku to installdevDependencies
(and not onlydependencies
), required to build browserify'sbundle.min.js
fileGMAP_API_KEY = <PUT YOUR KEY HERE>
: A Google Maps API v3 allowed for your heroku domain (see https://console.developers.google.com)
And to reference both heroku/nodejs
and https://github.com/weibeld/heroku-buildpack-run.git
buildpacks (either in the heroku dashboard, or by executing heroku buildpacks:add --index 1 heroku/nodejs && heroku buildpacks:add --index 2 https://github.com/weibeld/heroku-buildpack-run.git
)
The Background Geolocation Sample App is perfect for use with this web-application. To configure the app, simply edit Settings->url
and set it to http://<your.ip.ad.dress>:8080/locations
.
You should also configure Settings->autoSync
to false
while out field-testing as well, so that the app doesn't try syncing each recorded location to the server running on your localhost
. Once you return after a test and you're back on your office Wifi, click the [Sync] button on the Settings
screen to upload the cached locations to the Background Geolocation Console server.
Chris Scott of Transistor Software
BSD-licensed.