-
-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathgettingStarted.scala.html
More file actions
94 lines (85 loc) · 5.26 KB
/
gettingStarted.scala.html
File metadata and controls
94 lines (85 loc) · 5.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
@import controllers.documentation.ReverseRouter
@(examples: PlayExamples)(implicit requestHeader: RequestHeader, reverseRouter: ReverseRouter)
@renderProject(project: ExampleProject) = {
<tr>
<td><a href="@project.downloadUrl" target="_blank">@project.displayName</a></td>
<td><a href="@project.gitHubUrl" target="_blank">View on GitHub</a></td>
</tr>
}
@main("Getting Started with Play Framework", "getting-started") {
<header id="top">
<div class="wrapper">
<h1>Getting Started with Play Framework</h1>
</div>
</header>
<section id="content">
<article>
<div class="try-section">
<h2>New to Play?</h2>
<div class="try-option">
<h3><span>»</span> Learn whether Play Framework is right for your project</h3>
<div class="try-option-content">
<ul>
<li><a href="@reverseRouter.latest(None, "Introduction")" target="_blank">Introduction to Play</a></li>
<li><a href="@reverseRouter.latest(None, "Philosophy")" target="_blank">Our philosophy</a></li>
<li><a href="@reverseRouter.latest(None, "Requirements")" target="_blank">Requirements for using Play</a></li>
</ul>
</div>
</div>
<div class="try-option">
<h3><span>»</span> Try the Hello World Tutorial</h3>
<div class="try-option-content">
<p>The Java and Scala Hello World projects are self-contained tutorials that include a distribution of the sbt build tool.</p>
<p>Play requires Java 8 or higher. Check your version with the <code>java -version</code> command and if needed, install it from <a href="https://adoptium.net/" rel="noopener">Adoptium</a>.</p>
<p>To try the tutorial, first download the Java or Scala project:</p>
<table>
@examples.sections.map { case (version, section) =>
<tbody>
<tr><th><h4>Play @version Hello World Projects</h4></th></tr>
@section.tutorials.getOrElse("java", Seq.empty).map { (project) =>
@renderProject(project)
}
@section.tutorials.getOrElse("scala", Seq.empty).map { (project) =>
@renderProject(project)
}
</tbody>
}
</table>
<p>To run the tutorial:</p>
<ol>
<li>Unzip the project in a convenient location.</li>
<li>In a command window, change to the top-level project directory.</li>
<li>Enter <code>sbt run</code>.</li>
<li>After the message <code>Server started, ...</code> displays, enter the following URL in a browser: <a href="http://localhost:9000">http://localhost:9000</a></li>
</ol>
<p>The tutorial welcome page displays.</p>
</div>
</div>
</div>
<div class="try-section">
<h2>Already know a bit about Play?</h2>
<p>Lightbend offers a variety of <a href="https://www.lightbend.com/akka-platform/developers#example-projects">Play example projects for Java and Scala</a> that are focused on a particular use case. These include everything you need, including <a href="//www.scala-sbt.org/index.html">sbt</a>, Play Framework, and an HTTP server. The examples also support <a href="//docs.gradle.org/current/userguide/play_plugin.html">Gradle</a>.</p>
<p>If you are ready to start your own project and have sbt installed, you can create a Play project from the command line.</p>
<div class="try-option">
<h3><span>»</span> Create a Play Java or Scala project using <code>sbt new</code></h3>
<div class="try-option-content">
<p>In a command window, enter one of the following and respond to the prompts to create a new project:</p>
<h4>Java seed template</h4>
<pre>sbt new playframework/play-java-seed.g8</pre>
<h4>Scala seed template</h4>
<pre>sbt new playframework/play-scala-seed.g8</pre>
<p>After the template creates the project:</p>
<ol>
<li>Change into the top level project directory.</li>
<li>Enter <code>sbt run</code> to download dependencies and start the system.</li>
<li>In a browser, enter <a href="http://localhost:9000">http://localhost:9000</a> to view the welcome page.</li>
</ol>
</div>
</div>
</div>
</article>
<aside>
@commonSidebar()
</aside>
</section>
}