From: Alexandre Terrasa Date: Mon, 23 May 2016 20:12:01 +0000 (-0400) Subject: lib/popcorn: update angular example and test X-Git-Url: http://nitlanguage.org lib/popcorn: update angular example and test Signed-off-by: Alexandre Terrasa --- diff --git a/lib/popcorn/examples/angular/example_angular.nit b/lib/popcorn/examples/angular/example_angular.nit index ba7f4f2..9212a8e 100644 --- a/lib/popcorn/examples/angular/example_angular.nit +++ b/lib/popcorn/examples/angular/example_angular.nit @@ -40,5 +40,5 @@ end var app = new App app.use("/counter", new CounterAPI) -app.use("/*", new StaticHandler("www/")) +app.use("/*", new StaticHandler("www/", "index.html")) app.listen("localhost", 3000) diff --git a/lib/popcorn/tests/res/test_example_angular.res b/lib/popcorn/tests/res/test_example_angular.res index c07813f..bb94961 100644 --- a/lib/popcorn/tests/res/test_example_angular.res +++ b/lib/popcorn/tests/res/test_example_angular.res @@ -4,4 +4,19 @@ [Client] curl -s localhost:*****/counter -X POST {"label":"Visitors","value":1} [Client] curl -s localhost:*****/counter -{"label":"Visitors","value":1} \ No newline at end of file +{"label":"Visitors","value":1} +[Client] curl -s localhost:*****/not_found + + + + + ng-example + + +
+ + + + + + diff --git a/lib/popcorn/tests/test_example_angular.nit b/lib/popcorn/tests/test_example_angular.nit index d1ab509..821aa32 100644 --- a/lib/popcorn/tests/test_example_angular.nit +++ b/lib/popcorn/tests/test_example_angular.nit @@ -24,13 +24,14 @@ class TestClient system "curl -s {host}:{port}/counter" system "curl -s {host}:{port}/counter -X POST" system "curl -s {host}:{port}/counter" + system "curl -s {host}:{port}/not_found" # handled by angular controller return null end end var app = new App app.use("/counter", new CounterAPI) -app.use("/*", new StaticHandler("www/")) +app.use("/*", new StaticHandler("../examples/angular/www/", "index.html")) var host = test_host var port = test_port