/article

A weekend Go exercise project

Primary LanguageGo

Article

A weekend Go exercise project

App

restapi

REST API application. Accept and respond in JSON

  • GET /articles
    • query paremeter: author, keyword, limit, offset
  • POST /articles
    • body parameter:
        {
          "author": "string,required",
          "title": "string,required",
          "body": "string,required"
        }

Require

  • go 1.13
  • docker
  • docker-compose

How to

Test

make test

Run

docker-compose up -d  # prepare env. it takes time
cp env.sample .env    # create env var file
make migrate          # load/migrate database schema
make mapping          # apply index mappings
make compile          # compile 
make run              # run

Run Acceptence Test

make acceptence

Run in Docker

make build
docker run --network host --env-file .env prabudzak/article:latest