Skip to content

Simple server to assist in demonstrating TallyGo mobile SDK examples

Notifications You must be signed in to change notification settings

tallygo/TallyGo-Reference-Server

Repository files navigation

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

About

Simple server to assist in demonstrating TallyGo mobile SDK examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published