Closed Newverse-Wiki closed 9 months ago
"repo" is only a temporary setup to host wheel until pypi sorted out the WebAssembly wheel distribution problem. Don't spend too much time on that it can change anytime (and will).
In the near future importing a module will require main.py to support any one of those
https://peps.python.org/pep-0722/
https://peps.python.org/pep-0723/
on my local setup i do that:
user@pp /data/git $ file pygbag archives showroom
pygbag: directory
archives: directory
showroom: directory
user@pp /data/git $ python3 archives/server.py
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
that one start a normal webserver on port 8000 and keep running
pygbag --dev --template default.tmpl main.py
the second switch pygbag to port 8666 and fetch repo+wheels from archives/repo folder on http://localhost:8000 instead of internet you may have to put 0.8 files in pygbag/0.0/ if not using a full pygbag git build.
Thanks for your prompt and detailed reply.
I start and keep running the CDN server on my website server by
python3 archives/server.py
and proxy http://localhost:8000 -> https://games.example.com on server.
On local, I pack the game by
pygbag --cdn https://games.example.com/archives/0.8/ game_folder
I check the logs of both remote CDN server and local game server,
everything is going well and the game runs just fine.
I write these in case anyone might wish to self-host CDN server for archives/
Thanks a lot for your efforts on pygbag, wonderful job!
I upload
archives/
to my website server for better internet connections. The structure ofarchives/
on my server is like this:archives ├─ 0.8/ ├─ README.md ├─ favicon.ico ├─ repo/ └─ server.py
The URL of
archives/
on my server is like this: https://www.example.com/games/archives/When running pygbag, I specify the CDN with --cdn https://www.example.com/games/archives/0.8/
When GET the resources from CDN, files in
archives/0.8/
are availablebut files in
archives/repo/
got a wrong URLIt seems that when GET files in
repo/
the logic is not like "cd ../repo"So, must I put the
archives/
in the root/
of my website, like https://www.examples.com/archives/ Or any config options to specify where to Get files inrepo/
?