Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Walker Crouse <[email protected]>
  • Loading branch information
windy1 committed Mar 1, 2016
0 parents commit ac3c807
Show file tree
Hide file tree
Showing 14 changed files with 198 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
logs
project/project
project/target
target
tmp
.history
dist
/.idea
/*.iml
/out
/.idea_modules
/.classpath
/.project
/RUNNING_PID
/.settings


12 changes: 12 additions & 0 deletions app/controllers/Application.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package controllers

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

object Application extends Controller {

def index = Action {
Ok(views.html.index("Your new application is ready."))
}

}
7 changes: 7 additions & 0 deletions app/views/index.scala.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@(message: String)

@main("Welcome to Play") {

@play20.welcome(message)

}
15 changes: 15 additions & 0 deletions app/views/main.scala.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@(title: String)(content: Html)

<!DOCTYPE html>

<html>
<head>
<title>@title</title>
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
<link rel="shortcut icon" type="image/png" href="@routes.Assets.at("images/favicon.png")">
<script src="@routes.Assets.at("javascripts/jquery-1.9.0.min.js")" type="text/javascript"></script>
</head>
<body>
@content
</body>
</html>
13 changes: 13 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name := "pore"

version := "1.0"

lazy val `pore` = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.7"

libraryDependencies ++= Seq( jdbc , cache , ws , specs2 % Test )

unmanagedResourceDirectories in Test <+= baseDirectory ( _ /"target/web/public/test" )

resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases"
59 changes: 59 additions & 0 deletions conf/application.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This is the main configuration file for the application.
# ~~~~~

# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
# If you deploy your application to several instances be sure to use the same key!
application.secret="%APPLICATION_SECRET%"

# The application languages
# ~~~~~
application.langs="en"

# Global object class
# ~~~~~
# Define the Global object class for this application.
# Default to Global in the root package.
# application.global=Global

# Router
# ~~~~~
# Define the Router object to use for this application.
# This router will be looked up first when the application is starting up,
# so make sure this is the entry point.
# Furthermore, it's assumed your route file is named properly.
# So for an application router like `my.application.Router`,
# you may need to define a router file `conf/my.application.routes`.
# Default to Routes in the root package (and conf/routes)
# application.router=my.application.Routes

# Database configuration
# ~~~~~
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
# db.default.driver=org.h2.Driver
# db.default.url="jdbc:h2:mem:play"
# db.default.user=sa
# db.default.password=""

# Evolutions
# ~~~~~
# You can disable evolutions if needed
# evolutionplugin=disabled

# Logger
# ~~~~~
# You can also configure logback (http://logback.qos.ch/),
# by providing an application-logger.xml file in the conf directory.

# Root logger:
logger.root=ERROR

# Logger used by the framework:
logger.play=INFO

# Logger provided to your application:
logger.application=DEBUG

11 changes: 11 additions & 0 deletions conf/routes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~

# Home page
GET / controllers.Application.index

# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.at(path="/public", file)


1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=0.13.5
5 changes: 5 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
logLevel := Level.Warn

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.4.2")
Binary file added public/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/javascripts/jquery-1.9.0.min.js

Large diffs are not rendered by default.

Empty file added public/stylesheets/main.css
Empty file.
30 changes: 30 additions & 0 deletions test/ApplicationSpec.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._

import play.api.test._
import play.api.test.Helpers._

/**
* Add your spec here.
* You can mock out a whole application including requests, plugins etc.
* For more information, consult the wiki.
*/
@RunWith(classOf[JUnitRunner])
class ApplicationSpec extends Specification {

"Application" should {

"send 404 on a bad request" in new WithApplication{
route(FakeRequest(GET, "/boum")) must beNone
}

"render the index page" in new WithApplication{
val home = route(FakeRequest(GET, "/")).get

status(home) must equalTo(OK)
contentType(home) must beSome.which(_ == "text/html")
contentAsString(home) must contain ("Your new application is ready.")
}
}
}
24 changes: 24 additions & 0 deletions test/IntegrationSpec.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import org.specs2.mutable._
import org.specs2.runner._
import org.junit.runner._

import play.api.test._
import play.api.test.Helpers._

/**
* add your integration spec here.
* An integration test will fire up a whole play application in a real (or headless) browser
*/
@RunWith(classOf[JUnitRunner])
class IntegrationSpec extends Specification {

"Application" should {

"work from within a browser" in new WithBrowser {

browser.goTo("http://localhost:" + port)

browser.pageSource must contain("Your new application is ready.")
}
}
}

0 comments on commit ac3c807

Please sign in to comment.