8000 GitHub - pablotrianda/mock-it: ⚡ Mock a http server on the fly
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pablotrianda/mock-it

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

made-with-Go GitHub release status

MOCK-IT ⚡ Create a mock server on the fly

mockit -v <VERB> -e <ENDPOINT> -d <RESPONSE_DATA> -s <STATUS_CODE>

mockit

Download

Install with Go

go install github.com/pablotrianda/mock-it@latest

Flags

  • -v Http verb -> By default: GET
  • -e Endpoint -> By default: /
  • -d Data to respond -> By default: {"msg":"Hello from MOCKIT 🧉"}
  • -s Response status -> By default: 200
  • -p Port -> By default: 3000

Suported Http Verbs

  • GET
  • POST
  • DELETE
  • PUT
  • PATCH

Examples:

  • Create a simple server, run:

    $ mockit
    

    This will create a new server with the enpoint:
    GET - http://localhost:3000/ and response with {"msg":"Hello from MOCKIT 🧉"} and status 200

  • Create a server and responde a data from file:

    $ mockit -v post -e user -d data.json -s 202
    

    This will create a new server with the enpoint:
    POST - http://localhost:3000/user and response with the data.json data and status 202:
    data.json

    [
        {
            "user":123,
            "name":"foo"
        }
    ]
    

Run on development mode

  1. Clone this repo
  2. Run go run src/cmd/main.go
  3. To create a new build with dagger: go run build

Contact

You can reach me on Twitter @pablotrianda

About

⚡ Mock a http server on the fly

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

0