aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/templates/main.py
diff options
context:
space:
mode:
authorIgor Minar2012-08-25 02:30:55 -0700
committerIgor Minar2012-08-25 02:30:55 -0700
commitf7ac8ef97a12282e66eb540a542c09b9d14b2874 (patch)
treee1890f9b4808410522c40eb1bc752622e6ac7fbc /docs/src/templates/main.py
parent4a4b28dbf3af9a1871f00dfeded6da9eda557412 (diff)
downloadangular.js-f7ac8ef97a12282e66eb540a542c09b9d14b2874.tar.bz2
chore(docs): support _escaped_fragment_ hack for crawler
Diffstat (limited to 'docs/src/templates/main.py')
-rw-r--r--docs/src/templates/main.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/src/templates/main.py b/docs/src/templates/main.py
new file mode 100644
index 00000000..e31697d2
--- /dev/null
+++ b/docs/src/templates/main.py
@@ -0,0 +1,18 @@
+import webapp2
+from google.appengine.ext.webapp import template
+
+
+class IndexHandler(webapp2.RequestHandler):
+ def get(self):
+ fragment = self.request.get('_escaped_fragment_')
+
+ if fragment:
+ fragment = '/partials' + fragment + '.html'
+ self.redirect(fragment, permanent=True)
+ else:
+ self.response.headers['Content-Type'] = 'text/html'
+ self.response.out.write(template.render('index-nocache.html', None))
+
+
+app = webapp2.WSGIApplication([('/', IndexHandler)])
+