This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.marshalling.{Marshaller, PredefinedToEntityMarshallers, ToEntityMarshaller} | |
import akka.http.scaladsl.model.headers.RawHeader | |
import akka.http.scaladsl.model.{HttpRequest, MediaTypes} | |
import akka.http.scaladsl.server.Directives._ | |
import akka.stream.ActorMaterializer | |
import de.heikoseeberger.akkahttpjson4s.Json4sSupport | |
import org.json4s | |
import org.json4s.DefaultFormats |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.marshalling.{Marshaller, PredefinedToEntityMarshallers, ToEntityMarshaller} | |
import akka.http.scaladsl.model.headers.RawHeader | |
import akka.http.scaladsl.model.{HttpRequest, MediaTypes} | |
import akka.http.scaladsl.server.Directives._ | |
import akka.stream.ActorMaterializer | |
import de.heikoseeberger.akkahttpjson4s.Json4sSupport | |
import org.json4s | |
import org.json4s.DefaultFormats |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bject WebServer extends Json4sSupport { | |
def main(args: Array[String]) { | |
implicit val serialization = json4s.jackson.Serialization // or native.Serialization | |
implicit val formats = DefaultFormats | |
implicit val system = ActorSystem("my-system") | |
implicit val materializer = ActorMaterializer() | |
// needed for the future flatMap/onComplete in the end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run this in the Ammonite REPL (http://ammonite.io) | |
import $ivy.`com.typesafe.akka::akka-persistence:2.5.3` | |
import $ivy.`com.typesafe.akka::akka-persistence-cassandra:0.54` | |
import akka.actor.{ActorSystem, Props} | |
import akka.event.LoggingReceive | |
import akka.persistence.PersistentActor | |
import com.typesafe.config.ConfigFactory |