ååã®è¨äºãã¨ã©ã¼ã¡ãã»ã¼ã¸ããå¦ã¶Rack - æåã®ä¸æ©ãã®ç¶ãã§ãã åã«ããã¨Rackã«ã¯Middlewareãªãéæ³ãããããã§ããããã¦Rackå¤ææ¸ã«ã¯Middlewareã«ã¤ãã¦æ¬¡ã®ããã«ããã¾ãã useã®åªæãå±ããããããã°æã¯éããã æºå ååä½ã£ãããªãã¡ãã£ã¦Webãã¬ã¼ã ã¯ã¼ã¯ãdraqueããç¶ç¶ãã¦ä½¿ãã¾ããconfig.ruãå°ãé·ããªã£ãã®ã§ãWebã¢ããªã®æ¬ä½ãå¥ãã¡ã¤ã«draque.rbã«ç§»ãã¾ãã #draque.rb module Draque @@routes = { get:{} } def draque(env) path = env['PATH_INFO'] if res = @@routes[:get][path] res.call(env) else [ 404, headers, not_found ] end end def
{{#tags}}- {{label}}
{{/tags}}