Restructure the code to properly provide an API, and give proper responses on the web page #26

Closed
opened 2026-05-17 14:46:06 +02:00 by n07070 · 1 comment
Owner

I need to move the /api/ calls to the api.py file, and the calls coming from the web to the web.py file, with the form posting to it instead of the /api/ route

I need to move the /api/ calls to the api.py file, and the calls coming from the web to the web.py file, with the form posting to it instead of the /api/ route
Author
Owner

For example :

    else:
        app.logger.error("Method not allowed")
        # flash("Method not allowed")
        # return redirect(url_for("index"))
        return "Method not allowed, please POST", 405

    # flash("Picture printed ! ")
    # return redirect(url_for("index"))
    return "Picture printed !", 200
For example : ``` else: app.logger.error("Method not allowed") # flash("Method not allowed") # return redirect(url_for("index")) return "Method not allowed, please POST", 405 # flash("Picture printed ! ") # return redirect(url_for("index")) return "Picture printed !", 200 ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: n07070/littleprynter#26