Skip to content

Repository files navigation

README

How to run this application

Step 1 Create an env file with the following variables: SECRET_KEY_BASE = GEOLOCATION_API_KEY =

Step 2 With Docker and docker-compose installed, use the following command

docker-compose up --build

Step 3 Login with the following curl command

curl --location --request POST '0.0.0.0:3000/auth/sign_in?email=john%40gmail.com&password=topsecret'
--header 'Content-Type: application/json'
--header 'Accept: application/json'

Step 4

Copy the access token, client, and expiry headers from the retun on the user session reqest

Step 5

Use the following commands to interact with the system:

Index

curl --location '0.0.0.0:3000'
--header 'client: '
--header 'access-token: '
--header 'expiry: '
--header 'token-type: Bearer'
--header 'uid: john@gmail.com'
--header 'Cookie: '

Create

curl --location '0.0.0.0:3000/api/v1/geolocations'
--header 'client: '
--header 'access-token: '
--header 'expiry: '
--header 'token-type: Bearer'
--header 'uid: john@gmail.com'
--header 'Cookie: ' --header 'Content-Type: application/json'
--data '{ "ip_address": "172.217.12.110", "url": "https://google.com" }'

About

This is an api that consumes ipstack.com data and saves it to a database.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages