Using the application
To use our newly assembled web application, first ensure that the database setup steps and the Postman installation described in the Technical requirements section have been successfully completed. Then run the main()
method of class
WordzApplication
in IntelliJ. That starts the endpoint, ready to accept requests.
Once the service is running, the way we interact with it is by sending HTTP requests to the endpoint. Launch Postman and (on macOS) a window that looks like this will appear:
Figure 15.10 – Postman home screen
We first need to start a game. To do that, we need to send HTTP POST
requests to the /start
route on our endpoint. By default, this will be available at http://localhost:8080/start
. We need to send a body, containing the JSON {"
name":"testuser"}
text.
We can send this request from Postman. We click the Create a request button on the home page. This takes us to a view where we can enter...