Skip to content

Rails API for querying bus stops/services in Singapore

Notifications You must be signed in to change notification settings

nus-cs2030/cs2030-bus-api

Repository files navigation

CS2030 Bus API

All results are in plain text, separated by commas.

If an invalid bus stop number or bus service number is supplied, the page responds 404 Not Found with a 404 HTTP status.


/bus_services/<bus service number>

e.g. https://cs2030-bus-api.herokuapp.com/bus_services/95

Bus stops served by a particular bus service


/bus_stops/<bus stop number>

e.g. https://cs2030-bus-api.herokuapp.com/bus_stops/18331

Bus services that serve a particular bus stop


/bus_stops/<bus stop number>/nearby

e.g. https://cs2030-bus-api.herokuapp.com/bus_stops/18331/nearby

Bus stops that are within a 5-minute walking distance (~400m) of a particular bus stop


Setup

This guide assumes that you are developing on macOS.

  1. Install Ruby 2.4.1 (Recommended: rbenv or rvm)

  2. Install PostgreSQL (Recommended: Postgres.app or via Homebrew)

  3. Clone the repo and cd into it

  4. Run gem install bundler, followed by bundle to install all dependencies

  5. Run rails db:setup to create the database and populate the seed data

  6. Start the server with rails s and visit localhost:3000 to test that it works on your local machine

About

Rails API for querying bus stops/services in Singapore

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages