0

I made a pwa which I now want to publish to my website which uses flet. The problem is that I have no idea how to combine flet with with flask. I imagine the code would look something like this:

@app.route('/flashcards')
def flashcards():
    def main(page: ft.Page):
        page.title = "title"
        page.add(ft.Text("Test text"))

    ft.app(target=main, view=None, port=5000)

but every time I run it it says

Please wait while the application is being started...

and the error

Exception: Could not connected to Flet server in 30 seconds

Here is a log:

127.0.0.1 - - [26/Jun/2023 18:45:11] "GET /flutter_service_worker.js?v=2289608434 HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:12] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:14] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:16] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:18] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:20] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:22] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:24] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:26] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:27] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:29] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:31] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:33] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:34] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:36] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:38] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:40] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:42] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:44] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:46] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:48] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:50] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:53] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:55] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:57] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:45:59] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:46:00] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:46:02] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:46:04] "GET /ws HTTP/1.1" 404 -
127.0.0.1 - - [26/Jun/2023 18:46:06] "GET /ws HTTP/1.1" 404 -

0 Answers0