Last active
February 18, 2016 20:24
-
-
Save ysimonson/7120798 to your computer and use it in GitHub Desktop.
Tornado decorator to make an endpoint prerenderable for search engine crawlers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This has been turned into a full-fledged repo: | |
# https://github.com/dailymuse/torender |
@thoop - didn't see this comment before. Updated!
Can you provide an example of the method or handler using this decorator?
import tornado.ioloop
import tornado.web
from prerender import prerenderable
class MainHandler(tornado.web.RequestHandler):
@prerenderable
def get(self):
self.write("Hello, world")
application = tornado.web.Application([
(r"/", MainHandler),
], prerender_token="...")
if __name__ == "__main__":
application.listen(8888)
tornado.ioloop.IOLoop.current().start()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Line 6 should point to
http://service.prerender.io
instead of the old url