Mercurial > cgi-bin > hgwebdir.cgi > POP > oldRepo
view 1__Development/6__Website/POPBottleServer/basicServer.py @ 5:e73fbbcb5fd2
Persisting basic graph works, starting to add persist of view hierarchy too
| author | Sean Halle <seanhalle@yahoo.com> |
|---|---|
| date | Sun, 03 Aug 2014 23:38:15 -0700 |
| parents | |
| children |
line source
1 from bottle import route, run, template, response
3 @route('/hello/<name>')
4 def index(name):
5 return template('<b>Hello {{name}}</b>!', name=name)
7 @route('/savejson/<thejson>')
8 def index(thejson):
9 text_file = open("syntaxGraph.json", "w")
10 text_file.write("%s" % thejson)
11 text_file.close()
12 response.set_header('Access-Control-Allow-Origin', '*')
13 return 'Got JSON!'
14 # return template('Got JSON! {{printjson}}</b>!', printjson = thejson)
16 run(host='localhost', port=8080)
