def homepage(request):
conn = request.app['conn']
t = HTML_HDR
t += "<h2>%s</h2>" % conn.server_info
# NOTE: only a demo program would do all these remote server
# queries just to display the hompage...
donate = await conn.RPC('server.donation_address')
motd = await conn.RPC('server.banner')
t += '<pre style="font-size: 50%%">\n%s\n</pre><hr/>' % motd
t += '<p>Donations: %s</p>' % linkage(donate)
t += '</p><p>Top block: %s</p>' % linkage(top_blk)
t += '''
<form method=POST action="/">
<input name='q' style="width: 50%" placeholder="Txn hash / address / etc"></input>
'''
return Response(content_type='text/html', text=t)
评论列表
文章目录