|
@@ -9,19 +9,19 @@ events {
|
|
|
http {
|
|
|
access_log off;
|
|
|
lua_package_path 'CWD/openresty/?.lua;;';
|
|
|
- location /plaintext {
|
|
|
- default_type "text/plain";
|
|
|
- content_by_lua 'ngx.print("Hello, world!")';
|
|
|
- }
|
|
|
-
|
|
|
- location /json {
|
|
|
- default_type "application/json";
|
|
|
- content_by_lua 'ngx.print(require("cjson").encode({message = "Hello, World!"}))';
|
|
|
- }
|
|
|
server {
|
|
|
listen 8080;
|
|
|
+ location /plaintext {
|
|
|
+ default_type "text/plain";
|
|
|
+ content_by_lua 'ngx.print("Hello, world!")';
|
|
|
+ }
|
|
|
+
|
|
|
+ location /json {
|
|
|
+ default_type "application/json";
|
|
|
+ content_by_lua 'ngx.print(require("cjson").encode({message = "Hello, World!"}))';
|
|
|
+ }
|
|
|
location / {
|
|
|
- content_by_lua 'require("app").handler(ngx)';
|
|
|
+ content_by_lua 'require("app")()';
|
|
|
}
|
|
|
}
|
|
|
}
|