Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pretty URLs in Google App Engine

I want to pass a parameter 'A1B2C3' to a GWT application based on Google App Engine. I do it like www.example.com/index.html?key=A1B2C3. Although it's working, I'd like to use pretty URLs. Is it possible to do URL rewriting on Google App Engine? I couldn't find out how.

www.example.com/A1B2C3

instead of

www.example.com/index.html?key=A1B2C3

I'm using Google App Engine and GWT. All in Java.

like image 482
Mike Brecht Avatar asked Feb 19 '10 14:02

Mike Brecht


People also ask

How do I change my App Engine URL?

In the Google Cloud console, go to the Custom Domains tab of the App Engine Settings page. Click Add a custom domain. If your domain is already verified, the domain appears in the Select the domain you want to use section. Select the domain from the drop-down menu and click Continue.

What are the two kinds of instances available in App Engine standard?

App Engine supports the following scaling types, which controls how and when instances are created: Automatic (default) Basic. Manual.

Does App Engine standard support containers?

The App Engine standard environment is based on container instances running on Google's infrastructure. Containers are preconfigured with one of several available runtimes. The standard environment makes it easy to build and deploy an application that runs reliably even under heavy load and with large amounts of data.

How do your requests to services registered in a different region get routed to that region?

Requests can be routed in the following ways: Routing with URLs. Routing with a dispatch file. Routing with Cloud Load Balancing.


1 Answers

This is a cool question. I figured out how to do it for python as well.

app.yaml:

- url: /test/(.*)
  script: test.py \1

test.py:

#!/usr/bin/env python

import sys

def main():           
  for arg in sys.argv:
     print arg

if __name__ == '__main__':                               
  main()
like image 173
Kousha Avatar answered Oct 10 '22 04:10

Kousha