Curious Facts is a simple yet fun application that showcases my ability to integrate third-party APIs. Each time you refresh the page, it connects to an external API to fetch 10 random facts and displays them on the screen. While it is a basic project, it demonstrates my skills in API integration, even though I am still in the learning phase.
To run this application on your local environment, follow the steps below:
Open your terminal and run the following command:
git clone https://github.com/devguilhermeribeiro/curious_facts.git; cd curious_facts
Visit the API Ninjas website and obtain your API key. Then, create a .env
file at the root of the project and add your API key:
# .env
API_NINJAS_KEY=your-api-key
Run Bundler to install all necessary dependencies:
bundle install
Note: Make sure you have a Ruby development environment set up.
Finally, start the application with the command:
ruby app.rb
And there you go, you are "ON SINATRA"! 😄 Jokes aside, this application was developed using Ruby version 3.3.4. If you encounter any issues running it, ensure that your Ruby version is compatible or adapt the code to the version you are using.