dockerpostmanmockserver

Access mockserver from postman


I would like to set a mock server using https://mock-server.com/. As postman limits the numbers of calls with its free version I have opted for this tool. I have pulled and run the mock server docker image here is what I have when launching docker ps :

CONTAINER ID   IMAGE                                                                          COMMAND                  CREATED         STATUS         PORTS                                                                                                                                                                                                                                                            NAMES
b972ce4db023   mockserver/mockserver                                                          "java -Dfile.encodin"   6 seconds ago   Up 4 seconds   0.0.0.0:49153->1080/tcp                                                                                                                                                                                                                                          jovial_kala

My question is how can I make a call to this mock server now from postman?


Solution

  • Postman supports 1000 calls per month with its free license ,

    coming back to your question expose the container in any hostport and use it like any https://localhost:port/endpoint

    https://mock-server.com/where/docker.html

    to expose to hostport use:

       docker run -d --rm -p <theport you want to use>:1080 mockserver/mockserver
    

    eg: docker run -d --rm -p 9999:1080 mockserver/mockserver

    and the service will be now available at localhost:9999