mirror of
https://github.com/farcasclaudiu/learn-build-apps-copilot-agent.git
synced 2026-06-22 05:01:34 +03:00
1.1 KiB
1.1 KiB
Step 4: Wire API hosting for the multi-tier application
In this step, you will finalize API hosting for your multi-tier application:
- Keep backend API on port
8000. - Build Codespaces-aware API URL behavior using
$CODESPACE_NAME. - Validate endpoints with
curl.
⌨️ Activity: Configure API base URL and host support
Let's configure the Node.js API for Codespaces and localhost. - Backend runs on port 8000 - Build API base URL with $CODESPACE_NAME when available: https://$CODESPACE_NAME-8000.app.github.dev - Keep localhost support when $CODESPACE_NAME is not set - Verify /api/users and /api/activities with curl
-
Commit and push your changes to
build-octofit-app. -
Wait for Mona to validate and share the next step.
Having trouble? 🤷
Verify octofit-tracker/backend/src/server.ts includes:
CODESPACE_NAME-8000.app.github.dev