Run Mock Server

Run Mock Server

We just added a mock api, it is the time to click “Start” to button to launch the Mock Server now. But before we do that, we must make sure to map the mock server port(like 8088 in this example) to the host, or we can not access the mock server in the container.

  1. map the server port from container to host (skip this part if you already do that when you start the container).Stop the restbird container and start a new one by mapping the server port:
sudo docker run    -ti    -p 8080:8080 -p 8088:8088   -v /var/my-first-project:/data/restbird    restbird/rest

Best Practice

the best practice is when we start the container, we map a set of ports at that time, like: sudo docker run -ti -p 8080:8080 -p 9000-9100:9000-9100 -v /var/my-first-project:/data/restbird restbird/rest

  1. click “start” button and we can access the mock api at ’http://localhost:8088/helloworld

mock api