redweb 0.3.5 → 0.3.7

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
- const { HttpServer, HttpsServer } = require("./src/http");
1
+ const { HttpServer, HttpsServer, ENCODINGS, HTTP_OPTIONS } = require("./src/http");
2
2
  const { SecureSocketServer, SocketServer } = require("./src/ws");
3
3
 
4
4
  module.exports = {
5
- SecureSocketServer, SocketServer, HttpServer, HttpsServer
5
+ SecureSocketServer, SocketServer, HttpServer, HttpsServer, ENCODINGS, HTTP_OPTIONS
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redweb",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "A way to quickly set up an express server",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,6 +1,7 @@
1
1
  const express = require('express');
2
2
  const bodyParser = require('body-parser');
3
3
  const path = require('path');
4
+ const {HTTP_OPTIONS, ENCODINGS} = require('../static');
4
5
 
5
6
  /**
6
7
  * @typedef {'json' | 'urlencoded'} RedWebEncoding
@@ -20,17 +21,6 @@ const path = require('path');
20
21
  * @property {string} [ssl.cert] - Path to the SSL certificate file.
21
22
  */
22
23
 
23
- const ENCODINGS = { json: 'json', urlencoded: 'urlencoded' };
24
- const HTTP_OPTIONS = {
25
- port: 80,
26
- bind: '0.0.0.0',
27
- publicPaths: ['./public'],
28
- services: [],
29
- listenCallback: undefined,
30
- encoding: ENCODINGS.json,
31
- ssl: null
32
- };
33
-
34
24
  /**
35
25
  * Base HTTP Server
36
26
  * @param {RedWebOptions} options - Configuration options for RedWeb.
@@ -53,7 +43,5 @@ function BaseHttpServer(options = {}) {
53
43
  }
54
44
 
55
45
  module.exports = {
56
- BaseHttpServer,
57
- ENCODINGS,
58
- HTTP_OPTIONS
46
+ BaseHttpServer
59
47
  };
package/src/http/index.js CHANGED
@@ -1,4 +1,8 @@
1
+ const { ENCODINGS, HTTP_OPTIONS } = require('../static');
2
+
1
3
  module.exports = {
2
4
  HttpServer: require('./HttpServer'),
3
- HttpsServer: require('./HttpsServer')
5
+ HttpsServer: require('./HttpsServer'),
6
+ ENCODINGS,
7
+ HTTP_OPTIONS
4
8
  }
package/src/static.js ADDED
@@ -0,0 +1,12 @@
1
+ const ENCODINGS = { json: 'json', urlencoded: 'urlencoded' };
2
+ const HTTP_OPTIONS = {
3
+ port: 80,
4
+ bind: '0.0.0.0',
5
+ publicPaths: ['./public'],
6
+ services: [],
7
+ listenCallback: undefined,
8
+ encoding: ENCODINGS.json,
9
+ ssl: null
10
+ };
11
+
12
+ module.exports = {ENCODINGS, HTTP_OPTIONS}