Skip to content

shavo007/mockoon-demo

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

mockoon-demo

showcase mocking API using mockoon

Blog post: https://blog.shanelee.name/2021/08/29/mocking-a-rest-api-the-api-first-way-with-mockoon/

dockerise version 1.4.0 (detached mode)

npm update -g @mockoon/cli@1.4.0
mockoon-cli dockerize --data ./Greetings_Mockoon.json --port 3000 --index 0 --output ./Dockerfile

#Then manually amend the docker file to add in detached mode and specify the data arg. see [Dockerfile](./Dockerfile)

#To run with transaction log
docker run -p 3000:3000 mockoon-greeting-api

Kubernetes

docker build -t shanelee007/mockoon-greeting-api:1.0.0 .
#dry run (once only)
kubectl create deployment mockoon --image=shanelee007/mockoon-greeting-api:1.0.0 --dry-run=client --output=yaml > deployment.yaml
kubectl expose deployment mockoon --port=3000 --target-port=3000 --type=NodePort --dry-run=client --output=yaml > svc.yaml
kubectl apply -f deployment.yaml
kubectl apply -f svc.yaml
kubectl describe service mockoon
#access locally on node port
#inspect logs of the pod
kubectl logs -f <pod_name>