8000 GitHub - kapilnarotam/rateapi: API for delivering rate of the day for Zimbabwean market
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

kapilnarotam/rateapi

Repository files navigation

README

RateAPI to be used with rate application. Makes use of mysql database to store currencies, markets and prices.

Running the api in Docker Compose

NOTE Docker toolbox for mac and windows already comes with docker-compose. Linux users to install docker compose ontop of docker engine.

  • Clone API repo

  • edit config/database.yml to look like below

  adapter: mysql2
  encoding: utf8
  username: root
  password: pass #edit password to suit xampp configuration, default is blank. For docker, use "pass"
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  timeout: 5000
  host: mysql  #comment out line when using xampp 
  • Using terminal
  • CD into cloned folder
  • type the following:
  • docker-compose build
  • docker-compose up
  • In another terminal type the following
  • docker-compose run app rake db:create db:migrate db:seed

API container should be running, and see output visiting

  • machine-ip:3000/rates ; machine-ip:3000/markets ; machine-ip:3000/currencies

Running the api in windows

  adapter: mysql2
  encoding: utf8
  username: root
  password: #edit password to suit xampp configuration, default is left blank. For docker, use "pass"
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  timeout: 5000
  #host: mysql  #comment out line when using xampp 
  • Navigate to working directory with gitBash, type "bundle install" or "bundle update" to fetch gems
  • type "rake db:create db:migrate db:seed" to create table and populate it
  • Start another instance of gitBash in working directory, type "rails s" to start on default port 3000
  • check if API is working by visiting "localhost:3000/markets" or "localhost:3000/rates" or "localhost:3000/currencies"

About

API for delivering rate of the day for Zimbabwean market

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0