Giter Site home page Giter Site logo

geolocatr's Introduction

geolocatr

By Sarah Ovresat.

A web app that echoes out latitude and longitude information, given an IPv4 address.

How to set up and run

  1. Clone this repo into a directory.
  2. Duplicate the config.json.example file and rename it to config.json
  3. In config.json, set maxMind_accountID and maxMind_licenseKey.
  4. Run docker-compose build for an initial image.
  5. Once that's done, run docker-compose up. You will be able to access the app at localhost:3000
  6. Woo hoo! Now feed it IPv4 addresses. :)

Testing

For now, you can test the app manually by typing in input to the input field and submitting it. There is also an API endpoint that can be tested.

Front End Tests

Run the web app.

  1. Type in any string to the input field, and submit.
    • Pass: "Not a valid IPv4 address is" is displayed.
  2. Leave the field empty, and submit.
    • Pass: "Not a valid IPv4 address is" is displayed.
  3. Enter an address without periods.
    • Pass: "Not a valid IPv4 address is" is displayed.
  4. Enter an address with extra numbers.
    • Pass: "Not a valid IPv4 address is" is displayed.
  5. Make the api keys in config.json empty strings, and restart the app.
    • Pass: "An account ID and license key are required to use this service." is displayed.

Server Tests

Run the web app.

  1. Go to http://localhost:yourporthere/ip/
    • Pass: {"error":"No IP address provided."} is displayed.
  2. Go to http://localhost:yourporthere/ip/123121
    • Pass: {"error":"Not a valid IPv4 address."} is displayed.
  3. Go to http://localhost:3000/ip/104.28.22.115
    • Pass: {"latitude":-82.6763,"longitude":8.7891} is displayed.
  4. Make the api keys in config.json empty strings, and restart the app.
    • Pass: {"code":"ACCOUNT_ID_REQUIRED","error":"An account ID and license key are required to use this service."} is displayed.

geolocatr's People

Watchers

Sarah O avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.