Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

service-geoip

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

service-geoip

A RabbitMQ microservice wrapping the node-geoip package (geoip-lite on npm).

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
Maintainers
3
Weekly downloads
 
Created
Source

node-service-geoip

a RabbitMQ microservice wrapping the node-geoip package (geoip-lite on npm).

Codeship Codacy Badge Codacy Badge

project status

Done
  • Used in production
  • Dockerized
  • Deployable via Tutum
  • Uses BunnyMQ

service install

npm install service-geoip
npm updatedb used to build the geo DB. This is not needed when module is used as a client.

docker build

docker build .

configuration

configuration can be done using env vars

#default
AMQP_URL=amqp://localhost

#default
AMQP_QUEUE=geo:ip

usage

start the service

setup env vars and start the container or run npm start

npm start

consume the service

npm i bunnymq --save

Then in your code:

var bunny = require('bunnymq')(/*config here or use bunnymq's env vars*/).producer;
bunny.produce('geo:ip', '95.130.11.91', { rpc: true })
.then(function(loc){
  //use loc object here
});

consuming from a compatible amqp broker

just send the IP as the message content on the queue you have defined (see #configuration) with contentType set to application/json

Tutum

Here is a sample stackfile to deploy your microservice (create your tutum repository from the github repo first)

rabbitmq-master:
  image: 'tutum/rabbitmq:latest'
  environment:
    - RABBITMQ_PASS=PASSWORD
service-geoip:
  image: 'tutum.co/TUTUM_USER/service-geoip:latest'
  environment:
    - 'AMQP_URL=amqp://admin:PASSWORD@rabbitmq-master'
  links:
    - rabbitmq-master
  ports:
    - '9001:8080'

Keywords

FAQs

Package last updated on 22 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc