seanhalle@5: from bottle import route, run, template, response seanhalle@5: seanhalle@5: @route('/hello/') seanhalle@5: def index(name): seanhalle@5: return template('Hello {{name}}!', name=name) seanhalle@5: seanhalle@5: @route('/savejson/') seanhalle@5: def index(thejson): seanhalle@5: text_file = open("syntaxGraph.json", "w") seanhalle@5: text_file.write("%s" % thejson) seanhalle@5: text_file.close() seanhalle@5: response.set_header('Access-Control-Allow-Origin', '*') seanhalle@5: return 'Got JSON!' seanhalle@5: # return template('Got JSON! {{printjson}}!', printjson = thejson) seanhalle@5: seanhalle@5: run(host='localhost', port=8080)