Version resource on API with API and software version

This commit is contained in:
Gina Häußge 2014-06-23 13:31:31 +02:00
parent 76a9e94aed
commit 907f5051e1

View file

@ -32,6 +32,9 @@ from . import users as api_users
from . import log as api_logs
VERSION = "1.0"
def optionsAllowOrigin(request):
""" Always reply 200 on OPTIONS request """
@ -135,6 +138,14 @@ def apiPrinterState():
return make_response(("/api/state has been deprecated, use /api/printer instead", 405, []))
@api.route("/version", methods=["GET"])
@restricted_access
def apiVersion():
return jsonify({
"server": octoprint.server.VERSION,
"api": octoprint.server.api.VERSION
})
#~~ system control