Skip to content

temporalio/temporal-tutorial-ipgeo-ts

Repository files navigation

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

Start the Temporal Service locally using a database to persist data between runs:

$ temporal server start-dev --db-filename temporal.db

Start the web server to handle API and web requests:

$ npm run start.server

Now start the Temporal Worker

$ 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:

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •