Hey,
So I have single page application where all the routing is done in JavaScript (AngularJS). From the server I return only partial HTMLs as needed.
Now I'd like to make sure Google can index my application using _escaped_fragment_. Lets say I have following URL in my application:
http://example.com/user/profile/aIt would become:
http://example.com/?_escaped_fragment_=user/profile/aWhen Google is indexing my page.
That means that all requests would go through my IndexHandler that has to decide what to do with it.
Inside IndexHandler I'd like to somehow get the class that handless '/user/profile/a' so I can call special method on it that returns full HTML for a page (not partial).
Code would look something like this:
class IndexHandler(webapp2.RequestHandler):
def get(self):
# In my example this would return
'user/profile/a' fragment = self.request.GET.get('_escaped_fragment_', '')
if fragment:
fragment = '/' + fragment
# This is something I have no idea how to do
clas_Im_looking_for = XXXX(fragment).get_handler()
response = webapp2.Response()
handler = clas_Im_looking_for(request, response)
# Fragment get is my method
response = handler.fragment_get()
I appreciate any suggestions, Thanks!