Skip to content

stagas/maptail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

maptail

Tail GeoIP data on a world map in realtime.

Install

npm i -g maptail

Usage

# pipe logs into maptail
tail -f my-logs | maptail

# open the UI at http://localhost:3000

Options

  • --silent: suppress stdout output
  • --logs: show logs on screen (default: true)
  • --port <port>: port to listen on (default: env PORT or 3000)

Middleware API

You can embed maptail into an existing Node/Express HTTP server via a reusable middleware. It will intercept all writes to stdout (i.e from your logs) and serve the UI to the specified endpoint.

import express from 'express'
import morgan from 'morgan'
import { maptail } from 'maptail'

const app = express()
app.use(morgan('combined'))
app.use(maptail('/maptail'))

app.listen(3000, () => {
  console.log('Server listening on http://localhost:3000')
})

Attribution

maptail uses the IP2Location LITE database for IP geolocation.

License

MIT

Support

Buy Me A Coffee

About

Tail GeoIP data on a world map in realtime.

Topics

Resources

Stars

Watchers

Forks