Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

Commit

Permalink
Merge pull request #19 from GoingOK/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
andrewresearch authored Aug 2, 2017
2 parents 572313d + 6b04e14 commit 4a068b9
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 28 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[![Build Status](https://travis-ci.org/GoingOK/goingok-server.svg?branch=master)](https://travis-ci.org/GoingOK/goingok-server) [ ![bintray](https://api.bintray.com/packages/nlytx/nlytx_commons/nlytx_commons/images/download.svg?version=0.1.1) ](https://bintray.com/nlytx/nlytx_commons/nlytx_commons/0.1.1/link) [![https://img.shields.io/badge/license-Apache%202.0-blue.svg](https://img.shields.io/badge/license-Apache%202.0-lightgrey.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Build Status](https://travis-ci.org/GoingOK/goingok-server.svg?branch=master)](https://travis-ci.org/GoingOK/goingok-server)
<!-- [ ![bintray](https://api.bintray.com/packages/nlytx/nlytx_commons/nlytx_commons/images/download.svg?version=0.1.1) ](https://bintray.com/nlytx/nlytx_commons/nlytx_commons/0.1.1/link) -->
[![https://img.shields.io/badge/license-Apache%202.0-blue.svg](https://img.shields.io/badge/license-Apache%202.0-lightgrey.svg)](http://www.apache.org/licenses/LICENSE-2.0)

# goingok-server

Expand Down
50 changes: 24 additions & 26 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name := "goingok-server"
version := "1.0.0"
scalaVersion := "2.12.2"
version := "1.0.1"
scalaVersion := "2.12.3"
organization := "org.goingok"

//Enable this only for local builds - disabled for Travis
//enablePlugins(JavaAppPackaging)

//Scala library versions
val akkaVersion = "2.5.1"
val akkaStreamVersion = "2.5.1"
val akkaHttpVersion = "10.0.6"
val json4sVersion = "3.5.1"
val slickVersion = "3.2.0"
val slickpgVersion = "0.15.0-RC"
val akkaVersion = "2.5.3"
val akkaStreamVersion = "2.5.3"
val akkaHttpVersion = "10.0.9"
val json4sVersion = "3.5.3"
val slickVersion = "3.2.1"
val slickpgVersion = "0.15.3"
val slf4jVersion = "1.7.25"
//Java library versions
val googleClientApiVersion = "1.22.0"
val postgresDriverVersion = "42.0.0"
//val coreNlpVersion = "3.7.0"
val postgresDriverVersion = "42.1.4"

//Akka
libraryDependencies ++= Seq(
Expand All @@ -30,17 +30,10 @@ libraryDependencies ++= Seq(
libraryDependencies += "com.google.api-client" % "google-api-client" % googleClientApiVersion
//Sessions
libraryDependencies ++= Seq(
"com.softwaremill.akka-http-session" %% "core" % "0.4.0",
"com.softwaremill.akka-http-session" %% "jwt" % "0.4.0"
)
//NLP dependencies
libraryDependencies ++= Seq(
//"edu.stanford.nlp" % "stanford-corenlp" % coreNlpVersion,
//"edu.stanford.nlp" % "stanford-corenlp" % coreNlpVersion classifier "models-english" //,
//"com.google.protobuf" % "protobuf-java" % protoBufVers,
//("org.languagetool" % "language-en" % languageToolVers)
// .exclude("commons-logging", "commons-logging")
"com.softwaremill.akka-http-session" %% "core" % "0.5.1",
"com.softwaremill.akka-http-session" %% "jwt" % "0.5.1"
)

//Slick
libraryDependencies ++= Seq(
"com.typesafe.slick" %% "slick" % slickVersion,
Expand All @@ -52,17 +45,22 @@ libraryDependencies ++= Seq(
//General
libraryDependencies ++= Seq(
"io.nlytx" %% "commons" % "0.1.1",
// "au.edu.utscic" %% "cic-tap-nlp" % "0.1",
// "au.edu.utscic" %% "cic-tap-aws" % "0.1",
// "com.typesafe" % "config" % "1.3.1",
"org.json4s" %% "json4s-jackson" % json4sVersion,
"de.heikoseeberger" %% "akka-http-json4s" % "1.11.0",
"de.heikoseeberger" %% "akka-http-json4s" % "1.17.0",
// "org.scalactic" %% "scalactic" % "3.0.0",
"org.scalatest" %% "scalatest" % "3.0.0" % "test",
"org.scalatest" %% "scalatest" % "3.0.3" % "test",
"org.slf4j" % "jcl-over-slf4j" % slf4jVersion,
"ch.qos.logback" % "logback-classic" % "1.1.7"
"ch.qos.logback" % "logback-classic" % "1.2.3"
)

scalacOptions in (Compile, doc) ++= Seq("-doc-root-content", baseDirectory.value+"/src/main/scala/root-doc.md")

resolvers += Resolver.bintrayRepo("nlytx", "nlytx_commons")
resolvers += Resolver.bintrayRepo("nlytx", "nlytx_commons")

//Generate build info file
//lazy val root = (project in file(".")).
enablePlugins(BuildInfoPlugin)
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion)
buildInfoPackage := "org.goingok"
buildInfoOptions += BuildInfoOption.BuildTime
11 changes: 11 additions & 0 deletions src/main/scala/org/goingok/data/models/ServerInfo.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.goingok.data.models

/**
* Created by [email protected] on 2/8/17.
*/

case class ServerInfo(
name:String,
version:String,
buildTime:String
)
14 changes: 13 additions & 1 deletion src/main/scala/org/goingok/httpServer/GoingOkAPI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import akka.http.scaladsl.model.StatusCodes._
import akka.http.scaladsl.model.headers.RawHeader
import com.softwaremill.session.{SessionConfig, SessionManager}
import org.goingok._
import org.goingok.data.models.{GokId, ReflectionEntry, Research}
import org.goingok.data.models.{GokId, ReflectionEntry, Research, ServerInfo}
import org.goingok.handlers.{AuthorisationHandler, ProfileHandler}
import org.goingok.message.{HandlerMessage, JsonMessage}
import org.json4s.JsonAST.JString
Expand Down Expand Up @@ -113,5 +113,17 @@ trait GoingOkAPI extends GenericApi {

}

lazy val serverInfo = ServerInfo(BuildInfo.name,BuildInfo.version,BuildInfo.builtAtString)

override val adminRoutes = pathPrefix("admin") {
path("version") {
get {
log.info("Version request")
complete(serverInfo)
}
} ~
get { nothingHere }
}


}
2 changes: 2 additions & 0 deletions src/main/scala/org/goingok/httpServer/Server.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.goingok.httpServer

import akka.http.scaladsl.Http
import org.goingok.BuildInfo
import org.goingok.data.persistence.db.DatabaseOps

import scala.util.{Failure, Success}
Expand All @@ -24,6 +25,7 @@ object Server extends GoingOkAPI {
var dbOk = false

def startServer(address:String, port:Int) = {
log.info("->> STARTING {} - version {} <<-",BuildInfo.name,BuildInfo.version)
log.info("Connecting to DB server")
connectDb
log.info("Starting http server at {}:{}",address,port)
Expand Down

0 comments on commit 4a068b9

Please sign in to comment.