Running the application

The easiest way to run our API is in the SBT shell by issuing a run command. The project for this chapter is configured as a multi-module SBT project. Because of this, the run command has to be prefixed by the module name so that it is fully spelled as http4s/run as shown in the next screenshot:

Different components of our API will output lots of information. The application is started after the address of the HTTP server is shown. You can see how this looks on the bottom of the next screenshot:

After that, the API should serve HTTP requests, for example, issued with curl in another terminal window as the following screenshot demonstrates:

As our example uses in-memory database, it will lose its state after restart.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.52.188