import * as ez from 'ez-streams'
server = ez.devices.http.server(listener, options)
Creates an EZ HTTP server.
Thelistener
is called aslistener(request, response, _)
whererequest
is an EZ reader andresponse
an EZ writer.
For a full description of this API, seeHttpServerRequest/Response
in https://github.com/Sage/ez-streams/blob/master/lib/node-wrappers.mdclient = ez.devices.http.client(options)
Creates an EZ HTTP client.
client
is an EZ writer.
The response object returned byclient.response(_)
is an EZ reader.
For a full description of this API, seeHttpClientRequest/Response
in https://github.com/Sage/ez-streams/blob/master/lib/node-wrappers.mdlistener = ez.devices.http.listener(listener, options)
wraps an ez-streams listener as a vanilla node.js listenerfactory = ez.factory("http://user:pass@host:port/...")
Use reader for a GET request, writer for POST requestreader = factory.reader(_)
writer = factory.writer(_)