How to run flask server as portable elf

Hello i am working on a small project using electron js and flask.

I was wondering if there is a way to compile my flask server as an exe.

And run it in the background so the frontend(electron js) can send get and post requests

to my url e.g(get(“http://localhost:5050”)) something like that.

Any help would be appreciated.