Use flask.jsonify as we get it for free
parent
2a6c158f7c
commit
14aaedb284
|
@ -4,7 +4,7 @@
|
||||||
# Warsaw Hackerspace SpaceAPI service implementation
|
# Warsaw Hackerspace SpaceAPI service implementation
|
||||||
# 2013 Piotr 'inf' Dobrowolski <informatic@hackerspace.pl>
|
# 2013 Piotr 'inf' Dobrowolski <informatic@hackerspace.pl>
|
||||||
|
|
||||||
from flask import Flask
|
from flask import Flask, jsonify
|
||||||
import json
|
import json
|
||||||
import urllib2
|
import urllib2
|
||||||
import traceback
|
import traceback
|
||||||
|
@ -79,7 +79,7 @@ def api_index():
|
||||||
result['open'] = result['state']['open']
|
result['open'] = result['state']['open']
|
||||||
result['icon'] = result['state']['icon']
|
result['icon'] = result['state']['icon']
|
||||||
|
|
||||||
return json.dumps(result)
|
return jsonify(result)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True)
|
app.run(debug=True)
|
||||||
|
|
Loading…
Reference in New Issue