<s> """<STR_LIT>""" <EOL> from os import path <EOL> import asyncio <EOL> from growler import ( App ) <EOL> from growler . middleware import ( <EOL> Logger , <EOL> StringRenderer , <EOL> ) <EOL> app = App ( '<STR_LIT>' ) <EOL> view_dir = path . join ( path . dirname ( __file__ ) , "<STR_LIT>" ) <EOL> app . use ( Logger ( ) ) <EOL> app . use ( StringRenderer ( view_dir ) ) <EOL> @ app . get ( '<STR_LIT:/>' ) <EOL> def index ( req , res ) : <EOL> obj = { '<STR_LIT:title>' : "<STR_LIT>" } <EOL> res . render ( "<STR_LIT>" , obj ) <EOL> @ app . get ( '<STR_LIT>' ) <EOL> def hello_world ( req , res ) : <EOL> res . send_text ( "<STR_LIT>" ) <EOL> @ app . use <EOL> def error_handler ( req , res , err ) : <EOL> res . send_text ( "<STR_LIT>" ) <EOL> app . print_middleware_tree ( ) <EOL> loop = asyncio . get_event_loop ( ) <EOL> server_params = { <EOL> '<STR_LIT:host>' : '<STR_LIT:127.0.0.1>' , <EOL> '<STR_LIT:port>' : <NUM_LIT> , <EOL> } <EOL> make_server = loop . create_server ( app . _protocol_factory ( app ) , ** server_params ) <EOL> loop . run_until_complete ( make_server ) <EOL> loop . run_forever ( ) </s>
