From b3eb0d6cb77ccbcc422c5206bca5ccb48d201e08 Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Sat, 10 Mar 2018 22:05:19 -0600 Subject: [PATCH] server: Add skeleton for a play application --- server/build.sbt | 44 +++++++++++++++++++++++++++++++++ server/conf/application.conf | 7 ++++++ server/conf/logback.xml | 41 ++++++++++++++++++++++++++++++ server/conf/messages | 1 + server/conf/routes | 4 +++ server/project/build.properties | 1 + server/project/plugins.sbt | 2 ++ 7 files changed, 100 insertions(+) create mode 100644 server/build.sbt create mode 100644 server/conf/application.conf create mode 100644 server/conf/logback.xml create mode 100644 server/conf/messages create mode 100644 server/conf/routes create mode 100644 server/project/build.properties create mode 100644 server/project/plugins.sbt diff --git a/server/build.sbt b/server/build.sbt new file mode 100644 index 0000000..9c54c07 --- /dev/null +++ b/server/build.sbt @@ -0,0 +1,44 @@ +name := "xsn-block-explorer" +organization := "com.xsn" +scalaVersion := "2.12.2" + +fork in Test := true + +scalacOptions ++= Seq( +// "-Xfatal-warnings", + "-unchecked", + "-deprecation", + "-feature", + "-target:jvm-1.8", + "-encoding", "UTF-8", + "-Xfuture", + "-Xlint:missing-interpolator", + "-Yno-adapted-args", + "-Ywarn-dead-code", + "-Ywarn-numeric-widen", + "-Ywarn-value-discard", + "-Ywarn-unused", + "-Ywarn-unused-import" +) + + +val playsonifyVersion = "1.1.0-SNAPSHOT" + +lazy val root = (project in file(".")) + .enablePlugins(PlayScala) + + + +libraryDependencies ++= Seq(guice, ws) + +libraryDependencies += "com.alexitc" %% "playsonify" % playsonifyVersion +libraryDependencies += "com.google.inject" % "guice" % "4.1.0" +libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.4" + +libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.25" +libraryDependencies += "ch.qos.logback" % "logback-core" % "1.2.3" +libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.2.3" + +libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "3.1.0" % Test +libraryDependencies += "com.alexitc" %% "playsonifytest" % playsonifyVersion % Test +libraryDependencies += "org.mockito" % "mockito-core" % "2.15.0" % Test diff --git a/server/conf/application.conf b/server/conf/application.conf new file mode 100644 index 0000000..8236f1f --- /dev/null +++ b/server/conf/application.conf @@ -0,0 +1,7 @@ +# https://www.playframework.com/documentation/latest/Configuration + +play.i18n.langs = ["en"] + +play.filters.hosts { + allowed = ["localhost", "localhost:9000", "127.0.0.1:9000"] +} diff --git a/server/conf/logback.xml b/server/conf/logback.xml new file mode 100644 index 0000000..ffe7040 --- /dev/null +++ b/server/conf/logback.xml @@ -0,0 +1,41 @@ + + + + + + + ${application.home:-.}/logs/application.log + + %date [%level] from %logger in %thread - %message%n%xException + + + + + + %coloredLevel %logger{15} - %message%n%xException{10} + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/conf/messages b/server/conf/messages new file mode 100644 index 0000000..0226738 --- /dev/null +++ b/server/conf/messages @@ -0,0 +1 @@ +# https://www.playframework.com/documentation/latest/ScalaI18N diff --git a/server/conf/routes b/server/conf/routes new file mode 100644 index 0000000..2b18828 --- /dev/null +++ b/server/conf/routes @@ -0,0 +1,4 @@ +# Routes +# This file defines all application routes (Higher priority routes first) +# https://www.playframework.com/documentation/latest/ScalaRouting +# ~~~~ diff --git a/server/project/build.properties b/server/project/build.properties new file mode 100644 index 0000000..31334bb --- /dev/null +++ b/server/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.1.1 diff --git a/server/project/plugins.sbt b/server/project/plugins.sbt new file mode 100644 index 0000000..a6fc987 --- /dev/null +++ b/server/project/plugins.sbt @@ -0,0 +1,2 @@ +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.6") +