This repository contains code of API.
Go (golang), heroku, circleci, docker, redis, postgres. Web framework is a go kit wrapped with a code generation.
Run:
docker-compose up -d
echo "create database api_prod;" | docker-compose exec -T pg psql -Upostgres
It runs postgres and redis needed for both api and worker.
make run_api
make run_worker
Configurate via .env
file. Dev .env
may be like this:
WEB_ROOT="https://dev.golangci.com"
API_URL="https://api.dev.golangci.com"
GITHUB_CALLBACK_HOST=https://api.dev.golangci.com
DATABASE_URL="postgresql://postgres:test@localhost:5432/api_prod?sslmode=disable"
REDIS_URL="redis://127.0.0.1:6379"
PORT=3000
APP_NAME="GolangCI Dev"
Tests need .env.test
file, overriding options from .env
. There can be something like this:
DATABASE_URL="postgresql://postgres:test@localhost:5432/api_test?sslmode=disable"
DATABASE_DEBUG=1
echo "CREATE DATABASE api_test;" | docker-compose exec -T pg psql -U postgres
make test
Run golangci-web, golangci-worker and golangci-api. Go to https://dev.golangci.com
locally and it will work.
To use Subscriptions you will need to configure the env variables for the gateway of your choice.
- Note: Currently only SecurionPay is supported and uses
SECURIONPAY_SECRET
andSECURIONPAY_PLANID
.
Run ngrok http 3000
on your development machine, and use https://{ngrok_id}.ngrok.io/v1/payment/{gateway}/events
as URL to receive events from the payment gateway.
{gateway}
for SecurionPay issecurionpay
.{ngrok_id}
's are unique and you must update the callback URL when you restart Ngrok service.
See CONTRIBUTING.