docs(notifications): clarify ngrok guide so backend starts once
Consolidate first-run backend setup in section 1 and reframe section 2 as verification only, so local iPhone testing does not look like two separate startup steps.
This commit is contained in:
@@ -87,18 +87,32 @@ ngrok config add-authtoken YOUR_AUTHTOKEN_HERE
|
||||
|
||||
### Start a tunnel to the wakeup service
|
||||
|
||||
Assume the service listens on port **3000** (confirm in **notification-wakeup-service** `README` or `.env`):
|
||||
Assume the service listens on port **3000** (confirm in **notification-wakeup-service** `README` or `.env`).
|
||||
|
||||
If the service already defaults to port 3000 internally, you may not need to export PORT manually.
|
||||
|
||||
```bash
|
||||
# Terminal A — backend (see next section)
|
||||
# Terminal A — backend
|
||||
cd /path/to/notification-wakeup-service
|
||||
npm install
|
||||
npm run dev # or whatever starts the HTTP server on :3000
|
||||
|
||||
npm install
|
||||
|
||||
# one-time setup if needed
|
||||
cp .env.example .env
|
||||
|
||||
# configure Firebase/service account/etc as required
|
||||
export PORT=3000
|
||||
|
||||
npm run dev
|
||||
```
|
||||
|
||||
```bash
|
||||
# Terminal B — ngrok
|
||||
ngrok http 3000
|
||||
```
|
||||
|
||||
The backend only needs to be started once. The dedicated backend section below exists for verification and troubleshooting details, not as a second startup step.
|
||||
|
||||
ngrok prints a forwarding URL, for example:
|
||||
|
||||
```text
|
||||
@@ -113,13 +127,13 @@ Use the **HTTPS** URL (not `http://127.0.0.1:3000`). The iPhone cannot reach you
|
||||
|
||||
## 2. Start the backend locally
|
||||
|
||||
Example (adjust to match **notification-wakeup-service**):
|
||||
Example (adjust to match **notification-wakeup-service**). On first setup, copy `.env.example` to `.env` and set Firebase service account, `PORT`, and other variables per that repo's docs.
|
||||
|
||||
If the backend is not already running from section 1:
|
||||
|
||||
```bash
|
||||
# If not already running from the previous step:
|
||||
cd /path/to/notification-wakeup-service
|
||||
cp .env.example .env # if present
|
||||
# Set Firebase service account, PORT, etc. per that repo's docs
|
||||
export PORT=3000
|
||||
npm run dev
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user