octoprint_compat: Compatibility with Cura Octoprint plugin to upload UFP files.
This PR is a minimal implementation of the Octoprint REST API that is required for Cura to be able to establish a connection and send gcode/UFP files to moonraker without errors. Currently it only supports the "global apikey authentication" method. Signed-off-by: Nickolas Grigoriadis <nagrigoriadis@gmail.com>
This commit is contained in:
@@ -92,8 +92,7 @@ class MoonrakerApp:
|
||||
self.mutable_router = MutableRouter(self)
|
||||
app_handlers = [
|
||||
(AnyMatches(), self.mutable_router),
|
||||
(r"/websocket", WebSocket),
|
||||
(r"/api/version", EmulateOctoprintHandler)]
|
||||
(r"/websocket", WebSocket)]
|
||||
|
||||
self.app = tornado.web.Application(
|
||||
app_handlers,
|
||||
@@ -368,11 +367,3 @@ class FileUploadHandler(AuthorizedRequestHandler):
|
||||
raise tornado.web.HTTPError(
|
||||
e.status_code, str(e))
|
||||
self.finish(result)
|
||||
|
||||
|
||||
class EmulateOctoprintHandler(AuthorizedRequestHandler):
|
||||
def get(self):
|
||||
self.finish({
|
||||
'server': "1.1.1",
|
||||
'api': "0.1",
|
||||
'text': "OctoPrint Upload Emulator"})
|
||||
|
Reference in New Issue
Block a user