So the user/reader directly see the important files.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
all:
check:
- $(NITUNIT) . tests/
+ $(NITUNIT) . tests/ examples/
system "curl -s {host}:{port}/not_found" # handled by angular controller
end
- fun test_example_param_route do
+ fun test_example_angular do
var app = new App
app.use("/counter", new CounterAPI)
- app.use("/*", new StaticHandler("../examples/angular/www/", "index.html"))
+ app.use("/*", new StaticHandler("examples/angular/www/", "index.html"))
run_test(app)
end
end
<script src='/javascripts/ng-example.js'></script>
</body>
</html>
+
system "curl -s {host}:{port}/"
end
- fun test_example_glob_route do
+ fun test_example_post_handler do
var app = new App
app.use("/", new PostHandler)
run_test(app)
Body:
[Client] curl -s localhost:*****/ --data 'user'
-POST Error: user format error on user
URI: /
Body: user
<body>
<h1>404 Not Found</h1>
</body>
- </html>
\ No newline at end of file
+ </html>
system "curl -s {host}:{port}/?items=10\\&order=asc"
end
- fun test_example_glob_route do
+ fun test_example_query_string do
var app = new App
app.use("/", new QueryStringHandler)
run_test(app)
Query string: items=10&order=asc
items: 10
order: asc
+
system "curl -s {host}:{port}/about"
end
- fun test_example_param_route do
+ fun test_example_advanced_logger do
var app = new App
app.use_before("/*", new RequestTimeHandler)
app.use("/", new HelloHandler)
<body>
<h1>404 Not Found</h1>
</body>
- </html>
\ No newline at end of file
+ </html>
system "curl -s {host}:{port}/about"
end
- fun test_example_param_route do
+ fun test_example_html_error_handler do
var app = new App
app.use("/*", new HtmlErrorHandler)
run_test(app)
<body>
<h1>404 An error occurred!</h1>
</body>
- </html>
\ No newline at end of file
+ </html>
system "curl -s {host}:{port}/about"
end
- fun test_example_param_route do
+ fun test_example_simple_error_handler do
var app = new App
app.use("/", new HelloHandler)
app.use("/*", new SimpleErrorHandler)
[Client] curl -s localhost:*****/
Hello World!
[Client] curl -s localhost:*****/about
-An error occurred!
\ No newline at end of file
+An error occurred!
system "curl -s {host}:{port}/about"
end
- fun test_example_param_route do
+ fun test_example_simple_logger do
var app = new App
app.use_before("/*", new LogHandler)
app.use("/", new HelloHandler)
<body>
<h1>404 Not Found</h1>
</body>
- </html>
\ No newline at end of file
+ </html>
system "curl -s {host}:{port}/products/not_found"
end
- fun test_example_param_route do
+ fun test_example_session do
var app = new App
app.use("/*", new SessionInit)
app.use("/", new AppLogin)
<body>
<h1>404 Not Found</h1>
</body>
- </html>
\ No newline at end of file
+ </html>
system "curl -s {host}:{port}/not_found.nit"
end
- fun test_example_param_route do
+ fun test_example_static do
var app = new App
- app.use("/", new StaticHandler("../examples/static_files/public/"))
+ app.use("/", new StaticHandler("examples/static_files/public/"))
run_test(app)
end
end
<body>
<h1>404 Not Found</h1>
</body>
- </html>
\ No newline at end of file
+ </html>
system "curl -s {host}:{port}/not_found.nit"
end
- fun test_example_param_route do
+ fun test_example_static_default do
var app = new App
- app.use("/", new StaticHandler("../examples/static_files/public/", "default.html"))
+ app.use("/", new StaticHandler("examples/static_files/public/", "default.html"))
run_test(app)
end
end
<h1>Default Page</h1>
</body>
</html>
+
system "curl -s {host}:{port}/not_found.nit"
end
- fun test_example_param_route do
+ fun test_example_static_multiple do
var app = new App
- app.use("/", new StaticHandler("../examples/static_files/public/"))
- app.use("/", new StaticHandler("../examples/static_files/files/"))
- app.use("/static", new StaticHandler("../examples/static_files/public/"))
- app.use("/static", new StaticHandler("../examples/static_files/files/"))
+ app.use("/", new StaticHandler("examples/static_files/public/"))
+ app.use("/", new StaticHandler("examples/static_files/files/"))
+ app.use("/static", new StaticHandler("examples/static_files/public/"))
+ app.use("/static", new StaticHandler("examples/static_files/files/"))
run_test(app)
end
end
<body>
<h1>404 Not Found</h1>
</body>
- </html>
\ No newline at end of file
+ </html>