Skip to content

Commit

Permalink
http command in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
substack committed Nov 14, 2021
1 parent 4351cbf commit ab62aed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ var env = process.env
var minimist = require('minimist')
var pump = require('pump')
var argv = minimist(process.argv.slice(2), {
alias: { d: 'datadir', v: 'version', f: 'format', p: 'port' }
alias: { d: 'datadir', v: 'version', f: 'format', p: 'port', h: 'help' }
})

if (argv.help || argv._[0] === 'help') {
console.log(`
usage: ${process.argv[0]} COMMAND ...
usage: ${path.basename(process.argv[1])} COMMAND ...
query URI - list all features that intersect BBOX
Expand Down Expand Up @@ -106,7 +106,6 @@ if (argv.help || argv._[0] === 'help') {

var server = http.createServer(function handler(req, res) {
if (!isOpen) return openQueue.push(function () { handler(req, res) })
console.log(req.method, req.url)
if (req.method === 'GET') {
var ct = mime.getType(path.extname(req.url)) || 'application/octet-stream'
res.setHeader('content-type', ct)
Expand Down
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ usage: peermaps COMMAND ...
The rows of output are in georender format:
https://github.com/peermaps/docs/blob/master/georender.md
http URI - serve peermaps content from URI
URI is a hyper://, ipfs://, or https?:// link to the peermaps dataset
-p --port - server http on this port
```

example usage:
Expand Down

0 comments on commit ab62aed

Please sign in to comment.