mockit -v <VERB> -e <ENDPOINT> -d <RESPONSE_DATA> -s <STATUS_CODE>- Download the latest version from releases section.
go install github.com/pablotrianda/mock-it@latest
-vHttp verb -> By default:GET-eEndpoint -> By default:/-dData to respond -> By default:{"msg":"Hello from MOCKIT 🧉"}-sResponse status -> By default:200-pPort -> By default:3000
- GET
- POST
- DELETE
- PUT
- PATCH
-
Create a simple server, run:
$ mockitThis will create a new server with the enpoint:
GET - http://localhost:3000/and response with{"msg":"Hello from MOCKIT 🧉"}and status200 -
Create a server and responde a data from file:
$ mockit -v post -e user -d data.json -s 202This will create a new server with the enpoint:
POST - http://localhost:3000/userand response with the data.json data and status202:
data.json[ { "user":123, "name":"foo" } ]
- Clone this repo
- Run
go run src/cmd/main.go - To create a new build with dagger:
go run build
You can reach me on Twitter @pablotrianda
