mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
[Web] Add the "serve" and "run" scons targets.
You can now run the test HTTP server by calling: scons p=web serve If you also wish to run the browser, call instead: scons p=web run The default listen port is 8060, but can be overriden via the env variable GODOT_WEB_TEST_PORT which must be a valid integer.
This commit is contained in:
@@ -2,6 +2,20 @@
|
||||
|
||||
Import("env")
|
||||
|
||||
# The HTTP server "targets". Run with "scons p=web serve", or "scons p=web run"
|
||||
if "serve" in COMMAND_LINE_TARGETS or "run" in COMMAND_LINE_TARGETS:
|
||||
from serve import serve
|
||||
import os
|
||||
|
||||
port = os.environ.get("GODOT_WEB_TEST_PORT", 8060)
|
||||
try:
|
||||
port = int(port)
|
||||
except Exception:
|
||||
print("GODOT_WEB_TEST_PORT must be a valid integer")
|
||||
sys.exit(255)
|
||||
serve(env.Dir("#bin/.web_zip").abspath, port, "run" in COMMAND_LINE_TARGETS)
|
||||
sys.exit(0)
|
||||
|
||||
web_files = [
|
||||
"audio_driver_web.cpp",
|
||||
"display_server_web.cpp",
|
||||
|
||||
Reference in New Issue
Block a user