2Marks / go-exchangerate-api

Exchange rate API built with Go, leveraging a third-party API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About The Project

Exchange rate API built with Go leveraging a third-party API

Prerequisites

Make sure you have go installed on your machine

  • go
download from the [Go official site](https://go.dev/dl/)

Installation

  1. Get a Free API key at https://exchangesrateapi.com/
  2. Clone the repository
  3. Install go packages
go mod install
  1. Make a copy of .example.env file and rename to .env like so:
cp .example.env .env
  1. Update the env file with the right values as applicable

Usage

To start the app, please run: (tested on mac)

make run

or:

go run cmd/main.go

Example usage: Accessing the API endpoint:

to specify multiple to currencies: send them as a comma seperated value like so: (USD,GBP) e.g

http://localhost:8060/api/v1/exchange-rates?fromCurrency=EUR&toCurrency=USD,GBP

Feedback on the project stucture, quality are always welcome. thanks as you check it out

About

Exchange rate API built with Go, leveraging a third-party API


Languages

Language:Go 98.5%Language:Makefile 1.5%