Skip to content

im-kulikov/potter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Potter

Basic Fixture API service

Harry Potter

Quicklinks

Basic stuff

Installation

  • Go 1.11+
  • Go modules (for development)

Dependencies

see go.mod

Configuration

see config.yml

Example:

pprof:
  address: :6060

metrics:
  address: :8090

log:
  level: debug
  format: console

api:
  debug: true
  address: :8080
  shutdown_timeout: 10s

fixtures:
  # good example
  - method: GET
    url: /fake-json-example
    fixture: fixture.example.json
  # good example
  - method: POST
    url: /fake-echo-example
    echo: true
  # will be ignored (combine fixture and echo unsupported)
  - method: POST
    url: /fake-echo-example
    fixture: fixture.example.json
    echo: true
  # will be ignored (combine GET and echo unsupported)
  - method: GET
    url: /fake-echo-example
    echo: true

Explain

  • echo - puts POST request body to response, copy Content-Length
  • fixture - file of fixture
  • method - GET / POST / etc..
  • url - url 🙂
  1. echo can't be combined with GET
  2. echo can't be combined with fixture

Fixture example

any file contents

License

see License

Releases

No releases published

Packages

No packages published

Languages