From e1120040bbe843cc4d67e14b0b52fe580a466d6b Mon Sep 17 00:00:00 2001 From: seibo Date: Tue, 12 Jul 2011 16:02:30 -0700 Subject: [PATCH] Updated EWSGI specification (markdown) --- EWSGI-specification.md | 51 ++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/EWSGI-specification.md b/EWSGI-specification.md index a2b1e608..dd9ec204 100644 --- a/EWSGI-specification.md +++ b/EWSGI-specification.md @@ -73,37 +73,34 @@ This is the Eiffel application side. Basically one should be able to write: Result.set_status (Http_not_found) end end - end` + end Or to register handlers for specific URL paths (or regexp based URL path expressions): class APPLICATION - inherit - EW_APPLICATION - creation - make - redefine - make - features - - make is - do - register_handler (”/hello”, ~hello_world_handler) - -- The default execute feature will dispatch calls to the appropriate handler! - end - - hello_world_handler (env: ENVIRON): RESPONSE is - do - create Result - if env.path_info = ”/hello” then - Result.set_status (Http_ok) - Result.set_header (”Content-Type”, ”text/html; charset=utf-8”) - Result.put_contents (”Hello World”) - else - Result.set_status (Http_notund) - end - end - end + inherit + EW_APPLICATION + creation + make + redefine + make + feature + make is + do + register_handler (”/hello”, ~hello_world_handler) + -- The default execute feature will dispatch calls to the appropriate handler! + end + hello_world_handler (env: ENVIRON): RESPONSE is + do + create Result + if env.path_info = ”/hello” then + Result.set_status (Http_ok) + Result.set_header (”Content-Type”, ”text/html; charset=utf-8”) + Result.put_contents (”Hello World”) + else + Result.set_status (Http_notund) + end + end end ## Specification Details