Skip to content

fix: start server when rest_api is enabled and gate static file servi…#801

Open
CollegeRideOut wants to merge 1 commit intoEpicGamesExt:masterfrom
CollegeRideOut:fix/rest-api-without-web-frontend
Open

fix: start server when rest_api is enabled and gate static file servi…#801
CollegeRideOut wants to merge 1 commit intoEpicGamesExt:masterfrom
CollegeRideOut:fix/rest-api-without-web-frontend

Conversation

@CollegeRideOut
Copy link
Copy Markdown

@CollegeRideOut CollegeRideOut commented Apr 8, 2026

Fixes #767

Relevant components:

  • Signalling server
  • Common library
  • Frontend library
  • Frontend UI library
  • Matchmaker
  • Platform scripts
  • SFU

Problem statement:

When serve=false and rest_api=true, the REST API is not accessible.

Although the REST API routes and middleware are registered on the Express app via the OpenAPI initialize(...) call, the HTTP/HTTPS server is only started when serve=true through the WebServer. As a result, no server is listening to handle incoming API requests, which can lead to unexpected responses (e.g. 426 Upgrade Required).

Solution

Start the server when either serve or rest_api is enabled.

Additionally, static file serving (express.static) and the / homepage route are now conditionally applied only when serve=true.

This ensures:

  • The REST API is accessible when rest_api=true
  • Static content is only served when explicitly enabled via serve

Note: This change keeps the existing configuration structure. Fully separating server startup and static file serving would require introducing a dedicated configuration option (e.g. serve_static), which is outside the scope of this fix.

Documentation

No documentation changes required.

Test Plan and Compatibility

  • Verified that:

    • serve=false and rest_api=true → API is accessible
    • serve=true → static files and homepage are served as before
    • serve=true and rest_api=true → both API and static content work as expected
  • Existing behavior for static file serving remains unchanged when serve=true

  • Changes are limited to:

    • SignallingWebServer/src/WebServer.ts
    • SignallingWebServer/src/index.ts

    This Markdown was written with AI i wrote the code by hand

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 8, 2026

⚠️ No Changeset found

Latest commit: 0aa8d2d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] - Unable to access REST API without serving web front end

1 participant