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
-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
- GET
- POST
- DELETE
- PUT
- PATCH
-
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 status200
-
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 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