Skip to content
Snippets Groups Projects
Unverified Commit 01e16cb0 authored by Louis's avatar Louis :fire:
Browse files

Enhance Example

parent f7d1aad6
No related branches found
No related tags found
1 merge request!2Scripting
......@@ -3,10 +3,18 @@ print("We're going to the races");
foo = 1 + 1;
r = empty_response();
r:set_status(404);
-- r:set_header("foo", "bar");
-- r:set_body()
r:set_status(200);
r:set_header("X-Powered-By", "Swerve");
r:set_header("Content-Type", "text/plain");
r:set_body("This is my only response");
return response(200, "application/json", json_encode({ foo = 123 }));
--return r
r = response(200, "application/json", json_encode({ foo = 123 }));
r:unset_body();
r:set_status(204);
return r
-- return response(200, "application/json", '{ "foo": ' .. foo .. ' }')
\ No newline at end of file
......@@ -8,6 +8,7 @@
<body>
<h1>It's Swervin' Time</h1>
<p>This page is part of the swerve example, and includes a stylesheet and stuff.</p>
<img src="/files/adorable-puppy.jpg">
<script async src="js/say_hello.js"></script>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment