Class: Server

http.Server

new Server(options)

HTTPServer

Parameters:
Name Type Description
options Object
Properties
Name Type Description
node Fullnode
Source:
See:
Fires:
  • HTTPServer#event:websocket

Members

open

Open the server, wait for socket.

Source:

Methods

(private) _init()

Initialize routes.

Source:

(private) _initIO()

Initialize websockets.

Source:

close() → {Promise}

Close the server, wait for server socket to close.

Source:
Returns:
Type
Promise

del(path, handler)

Add a DEL route.

Parameters:
Name Type Description
path String
handler function
Source:

get(path, handler)

Add a GET route.

Parameters:
Name Type Description
path String
handler function
Source:

hook(pathnullable, handler)

Add a hook to the stack.

Parameters:
Name Type Attributes Description
path String <nullable>
handler function
Source:

listen(port, host) → {Promise}

Listen on port and host.

Parameters:
Name Type Description
port Number
host String
Source:
Returns:
Type
Promise

post(path, handler)

Add a POST route.

Parameters:
Name Type Description
path String
handler function
Source:

put(path, handler)

Add a PUT route.

Parameters:
Name Type Description
path String
handler function
Source:

use(pathnullable, handler)

Add a middleware to the stack.

Parameters:
Name Type Attributes Description
path String <nullable>
handler function
Source: