GO API project, that works with BTC-UAH rate
- GET /rate - returns current BTC-UAH rate
- POST /subscription - saves email (that passed thorough request body) to subscribers
- POST /sendEmail - sends current BTC-UAH rate to subscribers
After cloning this repo, there needed few more steps before working with it:
- For successful email sending add your mail credentials to
.envfile (EMAIL_ADDRESS, PASSWORD).
If you have 2-factor authentication on your account, you have to pass your application-password to PASSWORD field.
- To work via Dockerfile yo have to:
- run
docker build --tag btc-rate-api . - run
docker run -d -p 8080:8080 btc-rate-api
App will response for http://localhost:8080 url
- GET /rate
- 200 - returns BTC-UAH rate
- POST /subscription
- 201 - successfully save email
- 400 - email is not valid
- 409 - emails is subcribed already
- POST /sendEmail
- 200 - messages were successfully sent
App password generation: https://www.lifewire.com/get-a-password-to-access-gmail-by-pop-imap-2-1171882


