This repository contains the code for a simple API developed for the Genesis Software Engineering School 2023.
- Clone the repository:
git clone https://github.com/vadimpk/gses-2023.git
- Navigate to the project directory:
cd gses-2023
- Create
local/
directory in the root directory of the project. This is where the database file will be stored. - Get API key from CoinAPI. Or you can use my API key, which you can find in
config/config.go
. - Sign up for MailGun account. You will need to verify your domain and get your API key.
- Fill
.env
file in the root directory of the project with the following variables:
GSES_COIN_API_KEY=<your_coin_api_key>
GSES_MAILGUN_DOMAIN=<your_mailgun_domain>
GSES_MAILGUN_API_KEY=<your_mailgun_api_key>
GSES_MAILGUN_FROM=<your_mailgun_from_email>
- Run
make run
to start the server locally.
- Run
make docker-build
to build the docker image. - Run
make docker-run
to start the server in docker container.
/api/rate
(GET): get current bitcoin rate in UAH/api/subscribe
(POST): subscribe to mailing list/api/sendEmails
(POST): send emails with current currrency rate to all subscribers