Skip to content
Yuriy Lesyuk edited this page Oct 4, 2015 · 3 revisions

Scala SALAD

Install Jetty Install Derby DB Slick Derby Argonaut

Scala SALAD Slick Argonaut Lift Angular Derby DB

[Symbolic link to SALAD project directory] ln -s ~/YL/SALAD ~/SALAD

create /SALAD/_downloads directory add export SALAD_HOME=/SALAD

java -jar $JETTY_HOME/start.jar --module=http jetty.http.port=8080

github repository

?. cd scala-salad git init make .ignore

Install Jetty Download .zip v.9 from http://download.eclipse.org/jetty/ unzip into $SALAD_HOME

export JETTY_HOME=$SALAD_HOME/jetty-distribution-9.3.3.v20150827

Install Derby DB Download 10.11.1.1 from http://db.apache.org/derby/releases/release-10.11.1.1.cgi

unzip _downloads/db-derby-10.11.1.1-bin.zip into ~/SALAD ? make DERBY_HOME and add bin to the PATH while in derby home directory:

export DERBY_HOME=pwd PATH=$PATH:$DERBY_HOME/bin

?. Start in server mode with default port 1527 mkdir db-derby-home export DERBY_OPTS=-Dderby.system.home=$SALAD_HOME/db-derby-home

startNetworkServer

? Test the installation using ij connect 'jdbc:derby://localhost:1527/test-db;create=true';

connect 'jdbc:derby://localhost:1527/test-db';

select * from sys.systables

create table users ( id int primary key, name varchar(20), age int, position varchar(15)) ;

insert into users values (1, 'Jones', 25, 'Developer'); insert into users values (2, 'Watson', 27, 'Manager');

? project sbt file

Slick and Derby

?. SlickDerby.scala

Argonaut

? Add dependency

"io.argonaut" && "argonaut" % "6.0.4"

Lift and Jetty ? project/plugins.sbt addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0") addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "1.1.0")

?. Dependencies "com.typesafe.scala-logging" %% "scala-logging" % "3.1.0",

libraryDependencies ++= { val liftVersion = "2.6-RC1" Seq( "net.liftweb" %% "lift-webkit" % liftVersion % "compile", "net.liftweb" %% "lift-json" % liftVersion % "compile" ) }

jetty()

?. lift setup ? new folders src/main/webapp/WEB-INF

? web.xml

? new package bootstrap.liftweb

? new lift Boot class Boot.scala

? salad.intro.server.LiftRest.scala

? to generate .war file sbt package

? to run jetty container sbt container:start

Walkthrough Instructions ** Draft

Clone this wiki locally