- Web framework: Play
- Actors: akka
- Authentication: ?
- Authorization: ?
- ORM: doobie (for PostgreSQL)
- Evolutions: flyaway
- I/O: better-files
- JSON: circe + play-circe
This file contains 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
name := """play-scala""" | |
version := "1.0-SNAPSHOT" | |
lazy val root = (project in file(".")).enablePlugins(PlayScala) | |
scalaVersion := "2.11.7" | |
libraryDependencies ++= Seq( | |
jdbc, |
This file contains 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
# This is the main configuration file for the application. | |
# https://www.playframework.com/documentation/latest/ConfigFile | |
# ~~~~~ | |
# Play uses HOCON as its configuration file format. HOCON has a number | |
# of advantages over other config formats, but there are two things that | |
# can be used when modifying settings. | |
# | |
# You can include other configuration files in this main application.conf file: | |
#include "extra-config.conf" | |
# |
This file contains 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
[info] application - Creating Pool for datasource 'db' | |
[error] c.z.h.HikariConfig - either dataSource or dataSourceClassName is required | |
[error] application - | |
[info] | |
[info] ! @7105kp1a7 - Internal server error, for (GET) [/] -> | |
[info] | |
[info] play.api.Configuration$$anon$1: Configuration error[Cannot connect to database [db]] | |
[info] at play.api.Configuration$.configError(Configuration.scala:154) | |
[info] at play.api.Configuration.reportError(Configuration.scala:806) | |
[info] at play.api.db.DefaultDBApi$$anonfun$connect$1.apply(DefaultDBApi.scala:48) |
This file contains 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
val name: String = "Scala" | |
//shorter | |
val newName = "Scala" | |
// you can't assign new value | |
newName = "Java" // Error: reassignment to val name = "Java" |
This file contains 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
var age = 23 | |
//you can assign new values | |
age = 24 | |
age = 25 |
This file contains 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
val nameOfImmutableVariable: type = value | |
var nameOfMutableVariable: type = value |
This file contains 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
def methodName (argument: argumentType): returnType = { | |
//body of the method | |
} |
This file contains 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
def printHelloWorld: Unit = { | |
println("Hello world") | |
} |
This file contains 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
def sum(a: Int, b: Int): Int = { | |
a + b | |
} |
OlderNewer