Giter VIP home page Giter VIP logo

location-tracker-nodejs's Introduction

Cloudant Location Tracker

The Cloudant Location Tracker is a demo web application which records a device's location and saves this information to IBM Cloudant.

Cloning

Get the project and change into the project directory:

$ git clone https://github.com/cloudant-labs/location-tracker-nodejs.git
$ cd location-tracker-nodejs

Configuring Local Development

Local configuration is done through a .env file. One environment variable, VCAP_SERVICES, is needed in order to configure your local development environment. The value of the VCAP_SERVICES is a string representation of a JSON object. Here is an example .env file:

VCAP_SERVICES={"cloudantNoSQLDB": [{"name": "cloudant-location-tracker-db","label": "cloudantNoSQLDB","plan": "Shared","credentials": {"username": "your-username","password": "your-password","host": "your-host","port": 443,"url": "https://your-username:your-password@your-host"}}]}

Note: Services created within Bluemix are automatically added to the VCAP_SERVICES environment variable. Therefore, no configuration is needed for Bluemix.

Installing

Install the project's dependencies:

$ npm install

Running

Run the project through Foreman:

$ foreman start

Configuring IBM Bluemix

Complete these steps first if you have not already:

  1. Install the Cloud Foundry command line interface.
  2. Follow the instructions at the above link to connect to Bluemix.
  3. Follow the instructions at the above link to log in to Bluemix.

Create a Cloudant service within Bluemix if one has not already been created:

$ cf create-service cloudantNoSQLDB Shared cloudant-location-tracker-db

Deploying

To deploy to Bluemix, simply:

$ cf push

Note: You may notice that Bluemix assigns a URL to your app containing a random word. This is defined in the manifest.yml file. The host key in this file contains the value cloudant-location-tracker-${random-word}. The random word is there to ensure that multiple people deploying the Location Tracker application to Bluemix do not run into naming collisions. However, this will cause a new route to be created for your application each time you deploy to Bluemix. To prevent this from happening, replace ${random-word} with a hard coded (but unique) value.

License

Licensed under the Apache License, Version 2.0.

location-tracker-nodejs's People

Contributors

bradley-holt avatar seanbarclay avatar rajrsingh avatar

Watchers

Jess Mantaro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.