Skip to content

Instantly share code, notes, and snippets.

@edcote
Last active May 6, 2018 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edcote/9d97e33e4d134f58c4525dd7cd444e06 to your computer and use it in GitHub Desktop.
Save edcote/9d97e33e4d134f58c4525dd7cd444e06 to your computer and use it in GitHub Desktop.
Play Framework

Play Framework

Important files

Directory structure

  • conf/routes defines how application routes HTTP GET requests to an action. Example:
# URI '/' calls index view (index.scala.html) 
GET     /                           controllers.HomeController.index
  • controller/ MVC

  • services/ MVC

  • views/ MVC; uses Twirl template engine

Actions

Most requests received by a Play application are handled by an Action.

Controllers are action generators.

WebSockets

Allows full duplex communication to/from browser.

Actions are used to handle standard HTTP requests and send back responses.

IntelliJ

Use sbt run to compile. Then, navigate to http://localhost:9000. Re-compile should happen automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment