Introduction to Play Framework
The Play Framework is a web application framework for Scala and Java that emphasizes developer productivity and scalability.
Creating a Play App
sbt new playframework/play-scala-seed.g8
Run the app:
sbt run
Access the app at http://localhost:9000
.
Basic Controller
package controllers
import javax.inject._
import play.api.mvc._
@Singleton
class HomeController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {
def index() = Action {
Ok("Welcome to Play!")
}
}