GithubHelp home page GithubHelp logo

isabella232 / node-ip-location Goto Github PK

View Code? Open in Web Editor NEW

This project forked from developmentseed/node-ip-location

0.0 0.0 0.0 144 KB

A small node application to provide an endpoint to get the caller's location.

License: BSD 3-Clause "New" or "Revised" License

JavaScript 100.00%

node-ip-location's Introduction

node-ip-location Build Status

A small node application to provide an endpoint to get the caller's location.

Overview

We needed a way for a client-side application to get the user's rough location without going through the browser so we came up with this. It will check the incoming request for various parameters to try and come up with an IP address. It'll then call out to the NetImpact service to turn that IP into a general area.

Note that this is completely dependent on NetImpact's service which is rate limited. You will need to provide your own API key and depending on usage, can quickly run through the allowed daily limit.

Setting up your development environment

To set up the development environment for this app, you'll need to install the following on your system:

After these basic requirements are met, run the following commands in the root project folder:

$ npm install

You will need to set an environment variable for your API key or otherwise hardcode it.

API_KEY=foo

This application is designed to be run on Heroku (but can easily be changed to work elsewhere). As such, it may be worth installing the Heroku toolbelt.

Running the app

First, you should run the tests to make sure things are working as expected.

$ npm test

If something is not working, create an Issue.

To start the app, run the following command in the root project folder.

$ npm start

or if using Heroku toolbelt:

$ foreman start

Serves the application at: http://localhost:5000

Future improvements

This is a pretty simple utility so not a lot of things, but here is what I was thinking:

  • Find a different way to handle IP -> location conversion, it'd be nice not to have to be dependent on a rate-limited service.
  • Better handling of bad inputs, currently there are virtually none

Known issues

Contribution guidelines

There are many ways to contribute to a project, below are some examples:

  • Report bugs, ideas, requests for features by creating “Issues” in the project repository.

  • Fork the code and play with it, whether you later choose to make a pull request or not.

  • Create pull requests of changes that you think are laudatory. From typos to major design flaws, you will find a target-rich environment for improvements.

Style

There is no set style for this project, but please try to match existing coding styles as closely as possible.

Tests

If you're going to add new features, please make sure they come along with tests to make sure everything works as expected. Outside small changes, Pull Requests will not be accepted without associated tests.

node-ip-location's People

Contributors

jflasher 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.