Attic/programs/Application0.scala
author Christian Urban <urbanc@in.tum.de>
Wed, 31 May 2017 09:26:47 +0100
changeset 514 a118052cf1d4
parent 198 2ce98ee39990
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
package controllers
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
import play.api.mvc._
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
// hello world program 
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
// just answers the GET request with a string
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
object Application extends Controller {
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
  // answering a GET request
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
  val index = Action { request =>
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
    
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
    Ok("Hello world!")
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
  }  
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
  
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
}
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
/*
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
 * HTML can be returned using
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
 *
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
 * OK("<H1>Hello world!</H1>").as(HTML)
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
 *
2bd3530c30af added programs
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
 */