meadow-endpoints 3.0.7 → 4.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/Dockerfile_LUXURYCode +1 -1
- package/README.md +48 -14
- package/debug/Animal.json +62 -0
- package/debug/Harness-Configuration.json +31 -0
- package/debug/Harness.js +7 -108
- package/debug/KillHarness.sh +10 -0
- package/dist/meadowendpoints.js +4402 -0
- package/dist/meadowendpoints.min.js +92 -0
- package/dist/meadowendpoints.min.js.map +1 -0
- package/gulpfile.js +83 -0
- package/package.json +27 -15
- package/source/Meadow-Endpoints-Browser-Shim.js +14 -0
- package/source/Meadow-Endpoints.js +176 -565
- package/source/controller/Meadow-Endpoints-Controller-Base.js +161 -0
- package/source/controller/components/Meadow-Endpoints-Controller-BehaviorInjection.js +125 -0
- package/source/controller/components/Meadow-Endpoints-Controller-Error-StatusCodes.txt +189 -0
- package/source/controller/components/Meadow-Endpoints-Controller-Error.js +118 -0
- package/source/controller/components/Meadow-Endpoints-Controller-Log.js +103 -0
- package/source/controller/utility/Meadow-Endpoints-Filter-Parser.js +225 -0
- package/source/controller/utility/Meadow-Endpoints-Session-Marshaler.js +48 -0
- package/source/controller/utility/Meadow-Endpoints-Stream-RecordArray.js +66 -0
- package/source/endpoints/count/Meadow-Endpoint-Count.js +49 -0
- package/source/endpoints/count/Meadow-Endpoint-CountBy.js +40 -0
- package/source/endpoints/create/Meadow-Endpoint-BulkCreate.js +53 -0
- package/source/endpoints/create/Meadow-Endpoint-Create.js +58 -0
- package/source/endpoints/create/Meadow-Operation-Create.js +83 -0
- package/source/endpoints/delete/Meadow-Endpoint-Delete.js +93 -0
- package/source/endpoints/delete/Meadow-Endpoint-Undelete.js +108 -0
- package/source/endpoints/read/Meadow-Endpoint-Read.js +72 -0
- package/source/endpoints/read/Meadow-Endpoint-ReadDistinctList.js +92 -0
- package/source/endpoints/read/Meadow-Endpoint-ReadLiteList.js +85 -0
- package/source/endpoints/read/Meadow-Endpoint-ReadMax.js +55 -0
- package/source/endpoints/read/Meadow-Endpoint-ReadSelectList.js +89 -0
- package/source/endpoints/read/Meadow-Endpoint-Reads.js +75 -0
- package/source/endpoints/read/Meadow-Endpoint-ReadsBy.js +100 -0
- package/source/{crud → endpoints/read}/Meadow-Marshal-DistinctList.js +4 -13
- package/source/{crud → endpoints/read}/Meadow-Marshal-LiteList.js +5 -14
- package/source/endpoints/schema/Meadow-Endpoint-New.js +36 -0
- package/source/endpoints/schema/Meadow-Endpoint-Schema.js +36 -0
- package/source/endpoints/schema/Meadow-Endpoint-Validate.js +41 -0
- package/source/endpoints/update/Meadow-Endpoint-BulkUpdate.js +50 -0
- package/source/endpoints/update/Meadow-Endpoint-Update.js +58 -0
- package/source/endpoints/update/Meadow-Operation-Update.js +115 -0
- package/source/endpoints/upsert/Meadow-Endpoint-BulkUpsert.js +52 -0
- package/source/endpoints/upsert/Meadow-Endpoint-Upsert.js +57 -0
- package/source/endpoints/upsert/Meadow-Operation-Upsert.js +137 -0
- package/test/MeadowEndpoints_basic_tests.js +50 -2408
- package/test_support/bookstore-api-endpoint-exercises.paw +0 -0
- package/test_support/bookstore-configuration.json +28 -0
- package/test_support/bookstore-import-books-run.js +1 -0
- package/test_support/bookstore-import-books.js +215 -0
- package/test_support/bookstore-serve-meadow-endpoint-apis-IPC.js +138 -0
- package/test_support/bookstore-serve-meadow-endpoint-apis-run.js +6 -0
- package/test_support/bookstore-serve-meadow-endpoint-apis.js +129 -0
- package/test_support/data/books.csv +10001 -0
- package/test_support/model/ddl/BookStore.ddl +66 -0
- package/test_support/model/generated_diagram/README.md +1 -0
- package/test_support/model/generated_diagram/Stricture_Output.dot +13 -0
- package/test_support/model/generated_diagram/Stricture_Output.png +0 -0
- package/test_support/model/generated_documentation/Dictionary.md +18 -0
- package/test_support/model/generated_documentation/Model-Author.md +20 -0
- package/test_support/model/generated_documentation/Model-Book.md +26 -0
- package/test_support/model/generated_documentation/Model-BookAuthorJoin.md +14 -0
- package/test_support/model/generated_documentation/Model-BookPrice.md +25 -0
- package/test_support/model/generated_documentation/Model-Review.md +22 -0
- package/test_support/model/generated_documentation/ModelChangeTracking.md +17 -0
- package/test_support/model/generated_documentation/README.md +1 -0
- package/test_support/model/manual_scripts/DropTables.sql +5 -0
- package/test_support/model/manual_scripts/README.md +2 -0
- package/test_support/model/sql_create/BookStore-CreateDatabase.mysql.sql +116 -0
- package/test_support/model/sql_create/README.md +1 -0
- package/test_support/test_old/Tests.js +3243 -0
- package/test_support/test_old/untitled.js +88 -0
- package/source/Meadow-Authenticator.js +0 -31
- package/source/Meadow-Authorizers.js +0 -214
- package/source/Meadow-BehaviorModifications.js +0 -170
- package/source/Meadow-CommonServices.js +0 -206
- package/source/Meadow-MarshallSessionData.js +0 -64
- package/source/Restify-RouteParser.js +0 -114
- package/source/authorizers/Meadow-Authorizer-Allow.js +0 -17
- package/source/authorizers/Meadow-Authorizer-Deny.js +0 -17
- package/source/authorizers/Meadow-Authorizer-Mine.js +0 -47
- package/source/authorizers/Meadow-Authorizer-MyCustomer.js +0 -48
- package/source/crud/Meadow-Endpoint-BulkCreate.js +0 -67
- package/source/crud/Meadow-Endpoint-BulkUpdate.js +0 -74
- package/source/crud/Meadow-Endpoint-BulkUpsert.js +0 -76
- package/source/crud/Meadow-Endpoint-Count.js +0 -93
- package/source/crud/Meadow-Endpoint-CountBy.js +0 -101
- package/source/crud/Meadow-Endpoint-Create.js +0 -77
- package/source/crud/Meadow-Endpoint-Delete.js +0 -139
- package/source/crud/Meadow-Endpoint-Read.js +0 -109
- package/source/crud/Meadow-Endpoint-ReadDistinctList.js +0 -146
- package/source/crud/Meadow-Endpoint-ReadLiteList.js +0 -139
- package/source/crud/Meadow-Endpoint-ReadMax.js +0 -86
- package/source/crud/Meadow-Endpoint-ReadSelectList.js +0 -145
- package/source/crud/Meadow-Endpoint-Reads.js +0 -129
- package/source/crud/Meadow-Endpoint-ReadsBy.js +0 -155
- package/source/crud/Meadow-Endpoint-Undelete.js +0 -161
- package/source/crud/Meadow-Endpoint-Update.js +0 -80
- package/source/crud/Meadow-Endpoint-Upsert.js +0 -78
- package/source/crud/Meadow-Operation-Create.js +0 -105
- package/source/crud/Meadow-Operation-Update.js +0 -145
- package/source/crud/Meadow-Operation-Upsert.js +0 -106
- package/source/crud/Meadow-StreamRecordArray.js +0 -45
- package/source/schema/Meadow-Endpoint-New.js +0 -37
- package/source/schema/Meadow-Endpoint-Schema.js +0 -37
- package/source/schema/Meadow-Endpoint-Validate.js +0 -43
- package/test/Animal.json +0 -140
- package/test/MeadowEndpoints_disabledAuth_tests.js +0 -1325
- package/test/MeadowEndpoints_trustedSession_tests.js +0 -1731
- package/test/load/artillery-low.yml +0 -10
- package/test/load/cloud9setup.sh +0 -25
- package/test/load/package.json +0 -19
- package/test/load/test-schema-initializedatabase.sql +0 -29
- package/test/load/test-schema.json +0 -119
- package/test/load/test-server.js +0 -157
- package/test/scripts/InitializeDatabase-C9.sql +0 -7
- /package/{test/schemas → test_support/model}/json_schema/BookStore-Extended.json +0 -0
- /package/{test/schemas → test_support/model}/json_schema/BookStore-PICT.json +0 -0
- /package/{test/schemas → test_support/model}/json_schema/BookStore.json +0 -0
- /package/{test/schemas → test_support/model}/json_schema/README.md +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/BookStore-MeadowSchema-Author.json +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/BookStore-MeadowSchema-Book.json +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/BookStore-MeadowSchema-BookAuthorJoin.json +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/BookStore-MeadowSchema-BookPrice.json +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/BookStore-MeadowSchema-Review.json +0 -0
- /package/{test/schemas → test_support/model}/meadow_schema/README.md +0 -0
package/Dockerfile_LUXURYCode
CHANGED
|
@@ -62,7 +62,7 @@ ADD ./.config/luxury-extras/MySQL/MySQL-Laden-Entry.sh /usr/bin/MySQL-Laden-Entr
|
|
|
62
62
|
RUN ( sudo mysqld_safe --skip-grant-tables --skip-networking & ) && sleep 5 && mysql -u root < /home/coder/MySQL-Configure-Security.sql
|
|
63
63
|
|
|
64
64
|
# Import the initial database
|
|
65
|
-
COPY
|
|
65
|
+
COPY ./test_support/model/sql_create/BookStore-CreateDatabase.mysql.sql /home/coder/MySQL-Create-Databases.sql
|
|
66
66
|
RUN sudo service mariadb restart && sleep 5 && mysql -u root -p"123456789" -e "CREATE DATABASE bookstore;"
|
|
67
67
|
RUN sudo service mariadb restart && sleep 5 && mysql -u root -p"123456789" bookstore < /home/coder/MySQL-Create-Databases.sql
|
|
68
68
|
RUN sudo service mariadb restart && sleep 5 && mysql -u root -p"123456789" -e "CREATE DATABASE FableTest;"
|
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Automagic REST endpoints for basic CRUD operations on the Retold framework.
|
|
4
4
|
|
|
5
|
-
[](https://coveralls.io/r/stevenvelozo/meadow-endpoints?branch=master) [](https://travis-ci.org/stevenvelozo/meadow-endpoints) [](https://david-dm.org/stevenvelozo/meadow-endpoints) [](https://david-dm.org/stevenvelozo/meadow-endpoints#info=devDependencies)
|
|
6
|
-
|
|
7
5
|
This library generates REST endpoints in a consistent manner. Endpoints have the following features:
|
|
8
6
|
|
|
9
7
|
* Authentication
|
|
@@ -20,22 +18,12 @@ To best use this library, it should be in conjunction with [stricture](https://g
|
|
|
20
18
|
### Docker Development Environment
|
|
21
19
|
|
|
22
20
|
1. Run this command to build this image:
|
|
23
|
-
```
|
|
24
|
-
docker build ./ -t retold/meadow-endpoints:local
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
alternatively you can use npm to run this
|
|
28
21
|
|
|
29
22
|
```
|
|
30
23
|
npm run docker-dev-build-image
|
|
31
24
|
```
|
|
32
25
|
|
|
33
|
-
2. Run this command to
|
|
34
|
-
```
|
|
35
|
-
docker run -it --name meadow-endpoints-dev -p 127.0.0.1:12343:8080 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/meadow-endpoints" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" retold/meadow-endpoints:local
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
alternatively you can use npm to run this
|
|
26
|
+
2. Run this command to create and run the local container:
|
|
39
27
|
|
|
40
28
|
```
|
|
41
29
|
npm run docker-dev-run
|
|
@@ -45,4 +33,50 @@ npm run docker-dev-run
|
|
|
45
33
|
|
|
46
34
|
4. The password is "retold"
|
|
47
35
|
|
|
48
|
-
5. Right now you (may) need to delete the `node_modules` folders and regenerate it for Linux.
|
|
36
|
+
5. Right now you (may) need to delete the `node_modules` folders and regenerate it for Linux, depending on your OS.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## Pattern Description to Expand
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
const libMeadowEndpointsControllerBase = require('meadow-endpoints').ControllerBase;
|
|
44
|
+
|
|
45
|
+
class MySpecialLogController inherits libMeadowEndpointsControllerBase.LogControllerBase
|
|
46
|
+
{
|
|
47
|
+
constructor(pMeadowEndpoints, pOptions)
|
|
48
|
+
{
|
|
49
|
+
super(pMeadowEndpoints, pOptions);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Overload info to do something special
|
|
53
|
+
info(pLogText, ...pLogObjects)
|
|
54
|
+
{
|
|
55
|
+
super(pLogText, ...pLogObjects);
|
|
56
|
+
console.log('### THIS CONTROLLER DO MAGIC STUFF WITH'+pLogText);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
class MyMeadowEndpointsController
|
|
61
|
+
{
|
|
62
|
+
constructor(pMeadowEndpoints, pOptions)
|
|
63
|
+
{
|
|
64
|
+
super(pMeadowEndpoints, pOptions);
|
|
65
|
+
|
|
66
|
+
this._LogController = new mySpecialLogController(pMeadowEndpoints, pOptions);
|
|
67
|
+
|
|
68
|
+
this.initializeDefaultUnsetControllers(pMeadowEndpoints, pControllerOptions);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = MyMeadowEndpointsController;
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
let libMySpecialController = require('TheCodeAbove.js');
|
|
77
|
+
|
|
78
|
+
let tmpMeadow = new Meadow('INITIALIZE THE DAL');
|
|
79
|
+
|
|
80
|
+
let tmpMeadowEndpoints = new MeadowEndpoints(tmpMeadow, { Controller: libMySpecialController });
|
|
81
|
+
|
|
82
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Scope": "Animal",
|
|
3
|
+
|
|
4
|
+
"DefaultIdentifier": "IDAnimal",
|
|
5
|
+
|
|
6
|
+
"Schema": [
|
|
7
|
+
{ "Column": "IDAnimal", "Type":"AutoIdentity" },
|
|
8
|
+
{ "Column": "GUIDAnimal", "Type":"AutoGUID" },
|
|
9
|
+
{ "Column": "CreateDate", "Type":"CreateDate" },
|
|
10
|
+
{ "Column": "CreatingIDUser", "Type":"CreateIDUser" },
|
|
11
|
+
{ "Column": "UpdateDate", "Type":"UpdateDate" },
|
|
12
|
+
{ "Column": "UpdatingIDUser", "Type":"UpdateIDUser" },
|
|
13
|
+
{ "Column": "Deleted", "Type":"Deleted" },
|
|
14
|
+
{ "Column": "DeletingIDUser", "Type":"DeleteIDUser" },
|
|
15
|
+
{ "Column": "DeleteDate", "Type":"DeleteDate" },
|
|
16
|
+
{ "Column": "Name", "Type":"String" },
|
|
17
|
+
{ "Column": "Type", "Type":"String" },
|
|
18
|
+
{ "Column": "IDCustomer", "Type":"Number" }
|
|
19
|
+
],
|
|
20
|
+
|
|
21
|
+
"DefaultObject": {
|
|
22
|
+
"IDAnimal": null,
|
|
23
|
+
"GUIDAnimal": "",
|
|
24
|
+
|
|
25
|
+
"CreateDate": false,
|
|
26
|
+
"CreatingIDUser": 0,
|
|
27
|
+
"UpdateDate": false,
|
|
28
|
+
"UpdatingIDUser": 0,
|
|
29
|
+
"Deleted": 0,
|
|
30
|
+
"DeleteDate": false,
|
|
31
|
+
"DeletingIDUser": 0,
|
|
32
|
+
|
|
33
|
+
"Name": "Unknown",
|
|
34
|
+
"Type": "Unclassified",
|
|
35
|
+
"IDCustomer": 0
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
"JsonSchema": {
|
|
39
|
+
"title": "Animal",
|
|
40
|
+
"description": "A creature that lives in a meadow.",
|
|
41
|
+
"type": "object",
|
|
42
|
+
"properties": {
|
|
43
|
+
"IDAnimal": {
|
|
44
|
+
"description": "The unique identifier for an animal",
|
|
45
|
+
"type": "integer"
|
|
46
|
+
},
|
|
47
|
+
"Name": {
|
|
48
|
+
"description": "The animal's name",
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"Type": {
|
|
52
|
+
"description": "The type of the animal",
|
|
53
|
+
"type": "string"
|
|
54
|
+
},
|
|
55
|
+
"IDCustomer": {
|
|
56
|
+
"description": "The customer ID of the record",
|
|
57
|
+
"type": "number"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"required": ["IDAnimal", "Name", "CreatingIDUser"]
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Product": "MeadowEndpointsHarness",
|
|
3
|
+
"ProductVersion": "1.0.0",
|
|
4
|
+
|
|
5
|
+
"UUID":
|
|
6
|
+
{
|
|
7
|
+
"DataCenter": 0,
|
|
8
|
+
"Worker": 0
|
|
9
|
+
},
|
|
10
|
+
"LogStreams":
|
|
11
|
+
[
|
|
12
|
+
{
|
|
13
|
+
"streamtype": "simpleflatfile",
|
|
14
|
+
"path": "./BookStore-Run.log"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
|
|
18
|
+
"APIServerPort": 8086,
|
|
19
|
+
|
|
20
|
+
"UnauthorizedRequestDelay": 100,
|
|
21
|
+
|
|
22
|
+
"MySQL":
|
|
23
|
+
{
|
|
24
|
+
"Server": "127.0.0.1",
|
|
25
|
+
"Port": 3306,
|
|
26
|
+
"User": "root",
|
|
27
|
+
"Password": "123456789",
|
|
28
|
+
"Database": "FableTest",
|
|
29
|
+
"ConnectionPoolLimit": 20
|
|
30
|
+
}
|
|
31
|
+
}
|
package/debug/Harness.js
CHANGED
|
@@ -6,112 +6,11 @@
|
|
|
6
6
|
* @author Steven Velozo <steven@velozo.com>
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _HarnessBehavior = () =>
|
|
15
|
-
{
|
|
16
|
-
var tmpRecords = [
|
|
17
|
-
{GUIDAnimal:'0xHAXXXX', Name:'Jason', Type:'Triceratops'},
|
|
18
|
-
{Name:'Rover',Type:'Car'},
|
|
19
|
-
{GUIDAnimal:'0xDavison', Type:'Frog'}
|
|
20
|
-
];
|
|
21
|
-
_MockSessionValidUser.UserRoleIndex = 2;
|
|
22
|
-
libSuperTest('http://localhost:8080/')
|
|
23
|
-
.put('1.0/FableTest/Upserts')
|
|
24
|
-
.send(tmpRecords)
|
|
25
|
-
.end(
|
|
26
|
-
function(pError, pResponse)
|
|
27
|
-
{
|
|
28
|
-
// Expect response to be the record we just created.
|
|
29
|
-
var tmpResult = JSON.parse(pResponse.text);
|
|
30
|
-
console.log(JSON.stringify(tmpResult,null,4));
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
var tmpFableSettings = (
|
|
37
|
-
{
|
|
38
|
-
Product: 'MockOratorAlternate',
|
|
39
|
-
ProductVersion: '0.0.0',
|
|
40
|
-
|
|
41
|
-
"UnauthorizedRequestDelay": 1000,
|
|
42
|
-
|
|
43
|
-
APIServerPort: 8080,
|
|
44
|
-
|
|
45
|
-
MySQL:
|
|
46
|
-
{
|
|
47
|
-
// This is queued up for Travis defaults.
|
|
48
|
-
Server: "localhost",
|
|
49
|
-
Port: 3306,
|
|
50
|
-
User: "root",
|
|
51
|
-
Password: "",
|
|
52
|
-
Database: "FableTest",
|
|
53
|
-
ConnectionPoolLimit: 20
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
var libFable = require('fable').new(tmpFableSettings);
|
|
58
|
-
tmpFableSettings = libFable.settings;
|
|
59
|
-
|
|
60
|
-
var _MockSessionValidUser = (
|
|
9
|
+
//const libImporter = require('../test_support/bookstore-import-books.js');
|
|
10
|
+
//const libServer = require('../test_support/bookstore-serve-meadow-endpoint-apis.js');
|
|
11
|
+
const libServer = require('../test_support/bookstore-serve-meadow-endpoint-apis-IPC.js');
|
|
12
|
+
let _Orator = libServer(
|
|
13
|
+
()=>
|
|
61
14
|
{
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
UserRole: 'User',
|
|
65
|
-
UserRoleIndex: 1,
|
|
66
|
-
LoggedIn: true,
|
|
67
|
-
DeviceID: 'TEST-HARNESS'
|
|
68
|
-
});
|
|
69
|
-
var ValidAuthentication = function(pRequest, pResponse, fNext)
|
|
70
|
-
{
|
|
71
|
-
pRequest.UserSession = _MockSessionValidUser;
|
|
72
|
-
fNext();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
var _Meadow;
|
|
76
|
-
var _MeadowEndpoints;
|
|
77
|
-
|
|
78
|
-
var _AnimalSchema = require('./test/Animal.json');
|
|
79
|
-
|
|
80
|
-
// Now that we have some test data, wire up the endpoints!
|
|
81
|
-
|
|
82
|
-
// Load up a Meadow (pointing at the Animal database)
|
|
83
|
-
_Meadow = require('meadow')
|
|
84
|
-
.new(libFable, 'FableTest')
|
|
85
|
-
.setProvider('MySQL')
|
|
86
|
-
.setSchema(_AnimalSchema.Schema)
|
|
87
|
-
.setJsonSchema(_AnimalSchema.JsonSchema)
|
|
88
|
-
.setDefaultIdentifier(_AnimalSchema.DefaultIdentifier)
|
|
89
|
-
.setDefault(_AnimalSchema.DefaultObject)
|
|
90
|
-
.setAuthorizer(_AnimalSchema.Authorization);
|
|
91
|
-
|
|
92
|
-
// Instantiate the endpoints
|
|
93
|
-
_MeadowEndpoints = require('./source/Meadow-Endpoints.js').new(_Meadow);
|
|
94
|
-
var _Orator = require('orator').new(tmpFableSettings);
|
|
95
|
-
_Orator.enabledModules.CORS = true;
|
|
96
|
-
_Orator.enabledModules.FullResponse = true;
|
|
97
|
-
_Orator.enabledModules.Body = false;
|
|
98
|
-
|
|
99
|
-
var _SQLConnectionPool = libMySQL.createPool
|
|
100
|
-
(
|
|
101
|
-
{
|
|
102
|
-
connectionLimit: tmpFableSettings.MySQL.ConnectionPoolLimit,
|
|
103
|
-
host: tmpFableSettings.MySQL.Server,
|
|
104
|
-
port: tmpFableSettings.MySQL.Port,
|
|
105
|
-
user: tmpFableSettings.MySQL.User,
|
|
106
|
-
password: tmpFableSettings.MySQL.Password,
|
|
107
|
-
database: tmpFableSettings.MySQL.Database
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
// Start the web server
|
|
112
|
-
// Wire up an "always logged in" user in the request chain, so session is set right.
|
|
113
|
-
_Orator.webServer.use(ValidAuthentication);
|
|
114
|
-
// Wire the endpoints up
|
|
115
|
-
_MeadowEndpoints.connectRoutes(_Orator.webServer);
|
|
116
|
-
|
|
117
|
-
_Orator.startWebServer(_HarnessBehavior);
|
|
15
|
+
console.log('Service is started!');
|
|
16
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# This script is to kill the Harness, which can be annoying to do from the
|
|
4
|
+
# command line in the docker container when you are running remote
|
|
5
|
+
# debugging *or* the visual studio code debugger has gotten into a wonky
|
|
6
|
+
# state.
|
|
7
|
+
|
|
8
|
+
# Kill every process with Harness.js in it that isn't piping through grep...
|
|
9
|
+
|
|
10
|
+
kill $(ps aux | grep 'Harness.js' | grep -v 'grep' | awk '{print $2}')
|