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