https://github.com/iphytech/country-info
A simple web app that populate data of any given country
https://github.com/iphytech/country-info
restful-api ruby ruby-on-rails rubygem
Last synced: 3 months ago
JSON representation
A simple web app that populate data of any given country
- Host: GitHub
- URL: https://github.com/iphytech/country-info
- Owner: Iphytech
- Created: 2019-11-04T04:46:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-19T15:39:54.000Z (over 2 years ago)
- Last Synced: 2025-01-10T00:59:58.657Z (4 months ago)
- Topics: restful-api, ruby, ruby-on-rails, rubygem
- Language: Ruby
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How to use
Clone the repo `https://github.com/Iphytech/country-info.git` to your computer
change to the project directory
NB: There is no database (because we ain't going to make use of it).
go to the terminal and run `bundle or bundle install`
We are making use of `excon` for the restful api calls - Read more about it here (https://github.com/excon/excon)
And we are consuming data from `Rapid APi endpoint`For yuou to be able to use it, you have to signup on their website https://rapidapi.com/ and get the api key
We are going to use `Figaro gem` to save our credentials - See the documentation (https://github.com/laserlemon/figaro)
To use it
Got to the terminal and run `bundle exec figaro install`, This creates a commented config/application.yml file and adds it to your .gitignore. Add your own configuration to this file and you're done!
Go inside the application.yml file and add your rapudapi key like this
```ruby
api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```Start the project and test what we have built
```bash
rails s or rails server
```If you want to see the full response returned
Go to your controller in the search action and add this
```ruby
render :json => @country
```