mirror of
https://github.com/farcasclaudiu/learn-build-apps-copilot-agent.git
synced 2026-06-28 21:01:34 +03:00
Initial commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
## 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`.
|
||||
|
||||
### :keyboard: Activity: Configure API base URL and host support
|
||||
|
||||
> 
|
||||
>
|
||||
> ```prompt
|
||||
> 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
|
||||
> ```
|
||||
|
||||
1. Commit and push your changes to `build-octofit-app`.
|
||||
|
||||
1. Wait for Mona to validate and share the next step.
|
||||
|
||||
<details>
|
||||
<summary>Having trouble? 🤷</summary><br/>
|
||||
|
||||
Verify `octofit-tracker/backend/src/server.ts` includes:
|
||||
|
||||
- `CODESPACE_NAME`
|
||||
- `-8000.app.github.dev`
|
||||
|
||||
</details>
|
||||
Reference in New Issue
Block a user