Creating a minimal HTTPÂ server using Akka HTTP
In this recipe, we will see how to create a minimal HTTP server using routing DSL. We will also make use of the HttpApp
 trait, which provides a precooked server ready to be run.
Getting ready
To step through this recipe, we need to import the Hello-Akka
project; all the other prerequisites are the same as before. We need to get the required dependencies for http
 this time.
How to do it...
For this recipe, perform the following steps:
- Get the required dependencies.Â
- Edit theÂ
build.sbt
file and add the Akka HTTPÂ dependency as follows:
       libraryDependencies += "com.typesafe.akka" %        "akka-http_2.11" % "10.0.5"
Â
Â
- Now create a file named
MinimalHttpServer.scala
. Define your server and a small object to run it:
       package com.packt.chapter9        import akka.http.scaladsl.model.{ContentTypes, HttpEntity}        import akka.http.scaladsl.server.HttpApp        import akka.http.scaladsl.server.Directives._        import akka.http.scaladsl...