Add API endpoints for container management through Launchpad#173
Merged
runleveldev merged 17 commits intomainfrom Feb 6, 2026
Merged
Add API endpoints for container management through Launchpad#173runleveldev merged 17 commits intomainfrom
runleveldev merged 17 commits intomainfrom
Conversation
runleveldev
requested changes
Jan 30, 2026
Introduces a new router providing RESTful API endpoints for managing containers, including create, read, update, and delete operations with API key authentication. The new endpoints are mounted at the top level in server.js to support automation and API clients.
Removed api_containers.js and merged its API logic into containers.js. Now, API clients can interact with containers using Bearer token authentication on the main containers routes, supporting JSON responses for GET, POST, PUT, and DELETE operations. This unifies container management for both web and API clients and simplifies route maintenance.
Refactors the isApiRequest helper to detect API requests based on the Accept header instead of the Authorization header. This improves compatibility with clients expecting JSON responses.
Deleted the import of apiContainersRouter from server.js as it was not being used. This helps clean up the code and remove unnecessary dependencies.
fc77eaa to
3bb1a58
Compare
Removed isApiRequest from this file and imported it from ../utils/http-utils Applied requireAuth to the GET / route. Refactored GET / to unify the logic. It now runs the same database query for both API and HTML clients, calculating the service ports and statuses, and then switches the output format at the very end. Consolidated the 404 Site Not Found logic in GET /.
…e-server into cmyers_issue172
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #172
Introduces a new router providing RESTful API endpoints for managing containers, including create, read, update, and delete operations with API key authentication. The new endpoints are mounted at the top level in server.js to support automation and API clients.
Files changed:
api_containers.js : new API router (GET/POST/PUT/DELETE /containers) with Bearer API key auth.
server.js:1 : mounts the new router at top-level so /containers is available.