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

osm-p2p-server

Package Overview
Dependencies
Maintainers
2
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osm-p2p-server

serve osm http endpoints over a p2p db

  • 1.12.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
107
increased by494.44%
Maintainers
2
Weekly downloads
 
Created
Source

Build Status npm

osm-p2p-server

serve open street map 0.6 api endpoints over a local p2p http server

This package is available as a library you can use from node.js (or if you are creative, also the browser) or as a standalone command.

api example

var osmdb = require('osm-p2p')
var osm = osmdb('/tmp/osm-p2p')

var osmrouter = require('osm-p2p-server')
var router = osmrouter(osm)

var http = require('http')
var server = http.createServer(function (req, res) {
  if (router.handle(req, res)) {}
  else {
    res.statusCode = 404
    res.end('not found\n')
  }
})
server.listen(5000)

usage

usage: osm-p2p-server {OPTIONS}

-h --help     Show this message
-p --port     Listen on a port. Default: 5000
-d --datadir  Store data in this directory. Default: ./osm-p2p.db

api

var osmrouter = require('osm-p2p-server')

var router = osmrouter(osm)

Create a new open street maps server router given an osm-p2p-db handle osm.

var m = router.match(method, url)

Return a match object m if method and url can be handled by the server.

var m = router.handle(req, res)

Match the req.method and req.url and dispatch m.fn(m, req, res) and return the match object if there is a match.

differences

In changeset uploads (/api/0.6/changeset/:id/upload), the version property refers to a comma-separated list of version hashes of the documents that the update will replace.

install

npm install osm-p2p-server

license

BSD

Keywords

FAQs

Package last updated on 19 Aug 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