Skip to content

Commit

Permalink
Add Scalatra 3.0 examples
Browse files Browse the repository at this point in the history
  • Loading branch information
takezoe committed Oct 8, 2023
1 parent 49ce414 commit af8b238
Show file tree
Hide file tree
Showing 192 changed files with 51,656 additions and 0 deletions.
69 changes: 69 additions & 0 deletions 3.0/async/pekko-examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## generic files to ignore
*~
*.lock
*.DS_Store
*.swp
*.out

# rails specific
*.sqlite3
config/database.yml
log/*
tmp/*

# java specific
*.class

# python specific
*.pyc

# xcode/iphone specific
build/*
*.pbxuser
*.mode2v3
*.mode1v3
*.perspective
*.perspectivev3
*~.nib

# akka specific
logs/*

# sbt specific
target/
project/boot
lib_managed/*
project/build/target
project/build/lib_managed
project/build/src_managed
project/plugins/lib_managed
project/plugins/target
project/plugins/src_managed
project/plugins/project

core/lib_managed
core/target
pubsub/lib_managed
pubsub/target

# eclipse specific
.metadata
jrebel.lic
.settings
.classpath
.project

.ensime*
*.sublime-*
.cache

# intellij
*.eml
*.iml
*.ipr
*.iws
.*.sw?
.idea

# paulp script
/.lib/
16 changes: 16 additions & 0 deletions 3.0/async/pekko-examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# pekko-examples #

Corresponds to the guide at [http://scalatra.org/guides/3.0/async/pekko.html](http://scalatra.org/guides/3.0/async/pekko.html)

## Build & Run ##

```sh
$ git clone https://github.com/scalatra/scalatra-website-examples.git
$ cd scalatra-website-examples/3.0/async/pekko-examples
$ chmod +x sbt
$ ./sbt ~jetty:start
```

First, open [http://localhost:8080/ask](http://localhost:8080/ask) in your browser. You'll see the "question and answer" in the browser.

Second, Open [http://localhost:8080/](http://localhost:8080/) in your browser. You'll see the "question and answer" in your terminal.
21 changes: 21 additions & 0 deletions 3.0/async/pekko-examples/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
organization := "com.example"
name := "Pekko Examples"
version := "0.1.0-SNAPSHOT"
scalaVersion := "3.3.1"

val ScalatraVersion = "3.0.0"

libraryDependencies ++= Seq(
"org.apache.pekko" %% "pekko-actor" % "1.0.0" cross(CrossVersion.for3Use2_13),
"org.apache.pekko" %% "pekko-http" % "1.0.0" cross(CrossVersion.for3Use2_13),
"org.scalaj" %% "scalaj-http" % "2.4.2" cross(CrossVersion.for3Use2_13),
"ch.qos.logback" % "logback-classic" % "1.4.11" % Provided,
"org.scalatra" %% "scalatra-jakarta" % ScalatraVersion,
"org.scalatra" %% "scalatra-specs2-jakarta" % ScalatraVersion % "test",
"org.eclipse.jetty" % "jetty-webapp" % "11.0.15" % "provided",
"jakarta.servlet" % "jakarta.servlet-api" % "5.0.0" % "provided"
)

enablePlugins(JettyPlugin)

Jetty / containerLibs := Seq("org.eclipse.jetty" % "jetty-runner" % "11.0.15" intransitive())
1 change: 1 addition & 0 deletions 3.0/async/pekko-examples/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.9.6
2 changes: 2 additions & 0 deletions 3.0/async/pekko-examples/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.2.4")
scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")
Loading

0 comments on commit af8b238

Please sign in to comment.