Skip to content

Add API endpoints for container management through Launchpad#173

Merged
runleveldev merged 17 commits intomainfrom
cmyers_issue172
Feb 6, 2026
Merged

Add API endpoints for container management through Launchpad#173
runleveldev merged 17 commits intomainfrom
cmyers_issue172

Conversation

@cmyers-mieweb
Copy link
Collaborator

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.

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.
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 /.
@runleveldev runleveldev linked an issue Feb 6, 2026 that may be closed by this pull request
Copy link
Collaborator

@runleveldev runleveldev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@runleveldev runleveldev merged commit 9627363 into main Feb 6, 2026
4 checks passed
@runleveldev runleveldev deleted the cmyers_issue172 branch February 6, 2026 21:27
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.

Integrate API changes to integrate Launchpad builds

2 participants