Mercurial > cgi-bin > hgwebdir.cgi > POP > oldRepo
diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/1__Development/6__Website/POPBottleServer/basicServer.py Sun Aug 03 23:38:15 2014 -0700 1.3 @@ -0,0 +1,16 @@ 1.4 +from bottle import route, run, template, response 1.5 + 1.6 +@route('/hello/<name>') 1.7 +def index(name): 1.8 + return template('<b>Hello {{name}}</b>!', name=name) 1.9 + 1.10 +@route('/savejson/<thejson>') 1.11 +def index(thejson): 1.12 + text_file = open("syntaxGraph.json", "w") 1.13 + text_file.write("%s" % thejson) 1.14 + text_file.close() 1.15 + response.set_header('Access-Control-Allow-Origin', '*') 1.16 + return 'Got JSON!' 1.17 +# return template('Got JSON! {{printjson}}</b>!', printjson = thejson) 1.18 + 1.19 +run(host='localhost', port=8080) 1.20 \ No newline at end of file
