Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (35 sloc) 866 Bytes
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
try:
import json
except ImportError:
import simplejson as json
class MainHandler(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.out.write('Hello, webapp World!')
class TagsHandler(webapp.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/javascript'
url = self.request.path[6:]
data = {
"size1": 1,
"size2": 2,
"size3": 3,
"size4": 4,
"size5": 5,
"size6": 6,
"size7": 7,
"size8": 8,
}
self.response.out.write('taggly.callback(%s);' % json.dumps(data))
application = webapp.WSGIApplication(
[
('/tags/.*', TagsHandler),
('/', MainHandler)
],
debug=True)
def main():
run_wsgi_app(application)
if __name__ == "__main__":
main()