ScalaとPlayFrameworkで遊んでみる

ScalaとPlayFrameworkで遊んでみるの巻

  • brew install scala
  • brew install typesafe-activator
  • activator new
        Choose from these featured templates or enter a template name:
  1) minimal-akka-java-seed
  2) minimal-akka-scala-seed
  3) minimal-java
  4) minimal-scala
  5) play-java
  6) play-scala
(hit tab to see a list of all templates)
> 6
Enter a name for your application (just press enter for 'play-scala')
> test-play-scala
  • activator run (5分くらいかかった)
  • playページ表示 http://localhost:9000/
  • とりあえずhelloworld
    • vi test-play-scala/app/controllers/Application.scala
package controllers

import play.api._
import play.api.mvc._

object Application extends Controller {

  def index = Action {
    Ok("<p>Hello World!</p>").as(HTML)
  }

}
  • scalaファイルを編集した後にブラウザの再描画で更新された事には驚いた

参考にさせて頂きました