In my case, my frontend code is running on
https://pynecone-frontend.covidicq.net/
And backend code is running on
https://pynecone-backend.covidicq.net/
It's work for my snake game example.
The source code of snakegame is on
https://github.com/pynecone-io/pynecone-examples/tree/main/snakegame
And welcome to play and give me feedback
and I can improve it more:)
https://youtu.be/q2ydu3Wl-T0 <– [Video]Work for App, pc browser and mobile browser,
https://youtu.be/ZxBTrUvR3jo <– [Video]Play on native modible app
https://files.covidicq.net/python/snakegame.apk <- Download android apk
How do I make my snake game on self-hosting ?
I will guide you how to setting that in the following tutorial.
The both frontend code and backend code refers to this same configuration.
This config is says these three things
frontend will service in http://localhost:3711
backend will service in http://localhost:8701
In the frontend's source code, it will communicate with the backend on
https://xxxxx-backend.mydomain.net
In my strategy, I assign one domain for the frontend and another domain for the backend.
So when I setup my nginx setting, my plan is
(1)mapping https://xxxxx-backend.mydomain.net -> http://localhost:8701
(2)mapping https://xxxxx-frontend.mydomain.net -> http://localhost:3711
After these two things are finished, everything can run well .
The following is my detail setting related to nginx
The above two setting of nginx is the same.
What they do is support secure websocket and secure http.
In my case, I use AWS router-53 for DNS.
So the domain can mapping to the IP address that running my code.