orator-serviceserver-restify 2.0.1 → 2.0.2

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
@@ -1,2 +1,3 @@
1
- # orator-serviceserver-restify
2
- Restify Service Server for Orator
1
+ # Restify Orator Service Server
2
+
3
+ Restify abstraction for Orator. Needs more documentation. Feeling brave? You can `npm i` and `node debug/Harness.js` and it will serve up a silly test endpoint.
package/debug/Harness.js CHANGED
@@ -3,7 +3,7 @@ const defaultFableSettings = (
3
3
  {
4
4
  Product:'Orator-ServiceServer-Restify-Harness',
5
5
  ProductVersion: '1.0.0',
6
- APIServerPort: 8086
6
+ APIServerPort: 7766
7
7
  });
8
8
 
9
9
  // Initialize Fable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orator-serviceserver-restify",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Restify Service Server for Orator",
5
5
  "main": "source/Orator-ServiceServer-Restify.js",
6
6
  "scripts": {
@@ -46,8 +46,8 @@
46
46
  "restify": "^11.1.0"
47
47
  },
48
48
  "devDependencies": {
49
- "fable": "^3.0.73",
50
- "orator": "^4.0.1",
51
- "quackage": "^1.0.17"
49
+ "fable": "^3.0.96",
50
+ "orator": "^4.0.2",
51
+ "quackage": "^1.0.24"
52
52
  }
53
53
  }
@@ -9,12 +9,6 @@ const Expect = Chai.expect;
9
9
  const Assert = Chai.assert;
10
10
 
11
11
  const libFable = require('fable');
12
-
13
- const _Fable = new libFable({
14
- "Product": "Orator-ServiceServier-Restify-BasicTests",
15
- "ProductVersion": "0.0.0"
16
- })
17
-
18
12
  const libOrator = require('orator');
19
13
  const libOratorServiceServerRestify = require('../source/Orator-ServiceServer-Restify.js');
20
14
 
@@ -22,7 +16,7 @@ const libOratorServiceServerRestify = require('../source/Orator-ServiceServer-Re
22
16
 
23
17
  suite
24
18
  (
25
- 'Meadow-Endpoints-Core',
19
+ 'Orator Restify Abstraction',
26
20
  () =>
27
21
  {
28
22
  suite
@@ -35,13 +29,28 @@ suite
35
29
  'The class should initialize itself into a happy little object.',
36
30
  function (fDone)
37
31
  {
38
- let tmpOrator = new libOrator(_Fable, libOratorServiceServerRestify);
32
+ // Initialize fable
33
+ let tmpFable = new libFable();
34
+
35
+ // Add Restify as the default service server type
36
+ tmpFable.addServiceType('OratorServiceServer', libOratorServiceServerRestify);
37
+
38
+ // We can safely create the service now if we want, or after Orator is created. As long as it's before we initialize orator.
39
+ let tmpOratorServiceServerRestify = tmpFable.instantiateServiceProvider('OratorServiceServer', {});
40
+
41
+ // Add Orator as a service
42
+ tmpFable.addServiceType('Orator', libOrator);
43
+
44
+ // Initialize the Orator service
45
+ let tmpOrator = tmpFable.instantiateServiceProvider('Orator', {});
46
+ // Sanity check Orator
39
47
  Expect(tmpOrator).to.be.an('object', 'Orator should initialize as an object directly from the require statement.');
40
- Expect(tmpOrator.startService).to.be.an('function');
41
- Expect(tmpOrator.settings).to.be.an('object');
42
- tmpOrator.initializeServiceServer(
48
+
49
+ tmpOrator.initialize(
43
50
  (pError)=>
44
51
  {
52
+ Expect(tmpOrator.startService).to.be.an('function');
53
+
45
54
  Expect(tmpOrator.serviceServer.ServiceServerType).to.equal('Restify', 'The service server provider should be Restify.');
46
55
  fDone();
47
56
  });