• This repository has been archived on 11/Nov/2018
  • Stars
    star
    186
  • Rank 207,316 (Top 5 %)
  • Language
    CSS
  • License
    Other
  • Created about 12 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Interactive debug console

tv Logo

TV is an interactive debug console plugin for hapi

Build Status

Lead Maintainer: None.

TV is a simple web page in which developers can view server logs for their requests. Optionally, they can also filter the server logs to just their requests by attaching a unique client id to each request. The server will use WebSocket to stream the logs to the web application in real-time.

Here's what it looks like in action:

TV interactive debug console

Using TV in Your Application

To enable TV in a hapi application, install tv and register it. Below is an example of registering the tv plugin:

const Hapi = require('hapi');
const Tv = require('tv');

const server = new Hapi.Server();

server.register(Tv, (err) => {

    if (err) {
        throw err;
    }
    server.start();
});

In applications using multiple server instances, only one server can enable the debug interface using the default port.

Options

Below are the options available to be passed into the tv plugin:

  • host - the public hostname or IP address. Used only to set server.info.host and server.info.uri. Deaults to hostname and if not available to localhost(see hapi new Server()).
  • address - the hostname of IP address the WebSocket connection will bind to. Defaults to host if present otherwise 0.0.0.0(see hapi new Server()).
  • port - the port used by the WebSocket connection. Defaults to 0 and therefore an ephemeral port (see hapi new Server()).
  • endpoint - the debug console request path added to the server routes. Defaults to '/debug/console'.
  • queryKey - the name or the request query parameter used to mark requests being debugged. Defaults to debug.
  • template - the name of the template to use for the debug console. Defaults to index.
  • authenticateEndpoint - set this to true to use auth schemes for TVs main- and file delivering routes (defaults to false)

Below is an example of registering the tv plugin with some options:

const Hapi = require('hapi');
const Tv = require('tv');
const options = { endpoint: '/awesome' };

const server = new Hapi.Server();

server.register({ register: Tv, options: options }, function (err) {
    ...
});

More Repositories

1

oz

Web Authorization Protocol
JavaScript
1,532
star
2

postmile

Collaborative list making tool written in Node.js
JavaScript
405
star
3

university

Community learning experiment
JavaScript
374
star
4

lout

API documentation generator
JavaScript
277
star
5

metaphor

Open Graph, Twitter Card, and oEmbed Metadata Collector
JavaScript
230
star
6

hapijs.com

The hapijs.com website
JavaScript
183
star
7

bassmaster

Batch request plugin for hapi
JavaScript
139
star
8

poop

hapi plugin for handling uncaught exceptions
JavaScript
114
star
9

discuss

The "mailing list"
99
star
10

sntp

SNTP client (RFC4330) for node
JavaScript
82
star
11

hapi-contrib

Discussion forum for project contributors
78
star
12

rejoice

hapi.js CLI
JavaScript
64
star
13

penseur

Lightweight RethinkDB wrapper
JavaScript
62
star
14

hapi-auth-hawk

Hawk authentication plugin
JavaScript
47
star
15

scarecrow

Oz authentication plugin
JavaScript
45
star
16

postmile-api

Postmile API Server
JavaScript
43
star
17

reptile

Plugin for creating a REPL
JavaScript
23
star
18

postmile-web

Postmile Web server
JavaScript
18
star
19

mailback

Turns incoming emails to callbacks
JavaScript
15
star
20

catbox-mongodb

MongoDB adapter for catbox (hapi caching)
JavaScript
15
star
21

fireworks

@nodeconf July 4th Fireworks
JavaScript
13
star
22

lobotomy

Replace endpoints with temporary or permanent handlers
JavaScript
5
star
23

bananas

Minimal Loggly hapi plugin
JavaScript
5
star
24

radix62

Convert and parse numbers in base62
JavaScript
4
star
25

require-graphql

Adds GraphQL schema file support to require()
JavaScript
4
star
26

while

Random joi shotcuts
JavaScript
4
star
27

hippocampus

Redis-based object cache with change feed
JavaScript
3
star
28

tarnish

Turn a bunch of buffers into a tar buffer
JavaScript
2
star
29

apiece

Stream-like callback function
JavaScript
2
star
30

feud

Family Fued Website
JavaScript
1
star
31

marker

Cross modules and cross versions shared symbols
JavaScript
1
star