https://github.com/temporalio/temporal-tutorial-ipgeo-ts
https://github.com/temporalio/temporal-tutorial-ipgeo-ts
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/temporalio/temporal-tutorial-ipgeo-ts
- Owner: temporalio
- Created: 2024-12-04T04:48:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-03T02:09:12.000Z (12 months ago)
- Last Synced: 2025-07-25T07:47:30.548Z (11 months ago)
- Language: TypeScript
- Size: 99.6 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Get Address from IP
This application demonstrates using Temporal by calling two APIs in sequence.
It fetches the user's IP address and then uses that address to geolocate that user.
You can use the app in two ways:
- Through a web front-end
- Through a JSON POST request
In both cases, you provide a name that's included in the greeting.
## Using the app
The app requires the Temporal Service.
First, [Install the Temporal CLI](https://learn.temporal.io/getting_started/go/dev_environment/#set-up-a-local-temporal-service-for-development-with-temporal-cli)
Start the Temporal Service locally using a database to persist data between runs:
```bash
$ temporal server start-dev --db-filename temporal.db
```
Start the web server to handle API and web requests:
```bash
$ npm run start.server
```
Now start the Temporal Worker
```bash
$ npm start
```
Now visit http://localhost:3000 and enter your name to run the Workflow.
You can also issue a cURL request to start the Workflow:
```bash
curl -X POST http://localhost:3000/api -H "Content-Type: application/json" -d '{"name":"Brian Hogan"}'
```
Visit http://localhost:8233 to view the Event History in the Temporal UI.
Disable your internet connection and try again. This time you'll see the Workflow pause. Restore the internet connection and the Workflow completes.