Simple server to assist in demonstrating TallyGo mobile SDK examples
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
demo_data
doc
lib
public/stylesheets
routes
views
.gitignore
README.md
TallyGoSDKLicense.pdf
app.js
package-lock.json
package.json

README.md

TallyGo Reference Server

A very simple Node.js server that acts as a stand-in for your custom server backend, and demonstrates how you could exchange data between your mobile app and your own server. It implements a basic version of the server-side functionality as used in our iOS Reference App and Android Reference App.

Prerequisites

You need to have Node.js and NPM installed already.

Setup

Before running the server for the first time, execute this command:

npm install

You may also need to do this again whenever you do a git pull.

Configuration

By default, the server runs on port 3200. To use a different port, pass the PORT environment variable.

Running the Server

To start the server, run this command:

npm start

To exit the server, type Ctrl-C.

Development

Most of the interesting stuff is in the routes folder, particularly drivers.js.

Triggering Server to send fake WebSocket events for multiple vehicle demo

With the server running in another terminal window:

npm simulate

or

curl -X POST http://localhost:3200/simulation/start

The interval between WebSocket message broadcasts can be changed by editing the eventBroadcastInterval constant in the routes/multiple_vehicles.js file