1.0.0 • Published 7 years ago

elasticsearch-hapi v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

Hapi plugin for Elastic Search · NPM version · Standard - JavaScript Style Guide · Dependencies · Build Status · License: MIT

Originally forked from RapidApps/elasticsearch-hapi-plugin

Provides a central Elastic Search client for your other hapi plugins and server to use.

Features

  • Elastic Search logs through your hapi server
  • Elastic Search connection pool for entire server

Install

npm i -S elasticsearch-hapi

Usage example

See the Elastic Search configuration documentation for all the configuration options.

import esHapi from 'elasticsearch-hapi'
import Hapi from 'hapi'

const server = new Hapi.Server()

server.register({
  plugin: esHapi,
  options: {
    host: 'http://localhost:9200'
  }
}, (err) => {
  if (err) {
    throw err
  }

  server.start()
})