diff options
Diffstat (limited to 'example/staticFiles/app')
-rw-r--r-- | example/staticFiles/app/resources/cask/example.txt | 1 | ||||
-rw-r--r-- | example/staticFiles/app/src/StaticFiles.scala | 7 | ||||
-rw-r--r-- | example/staticFiles/app/test/src/ExampleTests.scala | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/example/staticFiles/app/resources/cask/example.txt b/example/staticFiles/app/resources/cask/example.txt new file mode 100644 index 0000000..5184576 --- /dev/null +++ b/example/staticFiles/app/resources/cask/example.txt @@ -0,0 +1 @@ +the quick brown fox jumps over the lazy dog
\ No newline at end of file diff --git a/example/staticFiles/app/src/StaticFiles.scala b/example/staticFiles/app/src/StaticFiles.scala index 4da9805..e47f0a1 100644 --- a/example/staticFiles/app/src/StaticFiles.scala +++ b/example/staticFiles/app/src/StaticFiles.scala @@ -5,8 +5,11 @@ object StaticFiles extends cask.MainRoutes{ "Hello!" } - @cask.static("/static") - def staticRoutes() = "cask/test/resources/cask" + @cask.staticFiles("/static/file") + def staticFileRoutes() = "app/resources/cask" + + @cask.staticResources("/static/resource") + def staticResourceRoutes() = "cask" initialize() } diff --git a/example/staticFiles/app/test/src/ExampleTests.scala b/example/staticFiles/app/test/src/ExampleTests.scala index ddf7de3..c60f443 100644 --- a/example/staticFiles/app/test/src/ExampleTests.scala +++ b/example/staticFiles/app/test/src/ExampleTests.scala @@ -19,7 +19,10 @@ object ExampleTests extends TestSuite{ val tests = Tests{ 'StaticFiles - test(StaticFiles){ host => - requests.get(s"$host/static/example.txt").text() ==> + requests.get(s"$host/static/file/example.txt").text() ==> + "the quick brown fox jumps over the lazy dog" + + requests.get(s"$host/static/resource/example.txt").text() ==> "the quick brown fox jumps over the lazy dog" } |