This repository has been archived by the owner on Aug 29, 2021. It is now read-only.
forked from angular/angular.js
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): support _escaped_fragment_ hack for crawler
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)]) | ||
|