@xeplr/base-apis 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -80,7 +80,6 @@ createApp(3000, 'myapp', {
80
80
  | option | |
81
81
  |---|---|
82
82
  | `requiredEnv` | variable names; any missing → message and `process.exit(1)` before anything starts |
83
- | `host` | the address to listen on, e.g. `'127.0.0.1'` for a service that only nginx on the same machine may reach. Default: every address |
84
83
  | `auth` | the gate — see below. **On when omitted** |
85
84
  | `middleware` | array, mounted after the gate |
86
85
  | `rawBodyPaths` | path prefixes whose body is also kept byte for byte as `req.rawBody` (a `Buffer`) — see below |
package/express.js CHANGED
@@ -14,8 +14,6 @@ var logs = require('@xeplr/logs');
14
14
  * @param {string} appName - Service name (used for debug namespace and console logs)
15
15
  * @param {object} [options] - Configuration options
16
16
  * @param {string[]} [options.requiredEnv] - Mandatory env var names; missing ones abort startup
17
- * @param {string} [options.host] - The address to listen on, e.g. '127.0.0.1' for a service only a
18
- * proxy on the same machine may reach. Default: every address (Node's own default).
19
17
  * @param {object} [options.routes] - Route map: { '/path': router }
20
18
  * @param {object|false} [options.auth] - THE GATE, ON BY DEFAULT.
21
19
  * Omit it and every route requires a valid token, validated by asking the
@@ -253,7 +251,7 @@ function createApp(port, appName, options) {
253
251
 
254
252
  // ── Start HTTP server ──
255
253
  app.set('port', port);
256
- var server = createServer(app, port, appName, options.host);
254
+ var server = createServer(app, port, appName);
257
255
 
258
256
  return { app: app, server: server };
259
257
  }
package/lib/server.js CHANGED
@@ -7,14 +7,12 @@ function normalizePort(val) {
7
7
  return false;
8
8
  }
9
9
 
10
- function createServer(handler, port, name, host) {
10
+ function createServer(handler, port, name) {
11
11
  const dbg = require('debug')('architects:' + name);
12
12
  const normalizedPort = normalizePort(port);
13
13
 
14
14
  const server = http.createServer(handler);
15
- // A host only for a port: a named pipe has none.
16
- if (host && typeof normalizedPort === 'number') server.listen(normalizedPort, host);
17
- else server.listen(normalizedPort);
15
+ server.listen(normalizedPort);
18
16
 
19
17
  server.on('error', function onError(error) {
20
18
  if (error.syscall !== 'listen') throw error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeplr/base-apis",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "Base API bootstrapper — Express and plain HTTP server factories with middleware injection",
5
5
  "main": "index.js",
6
6
  "bin": {