Skip to content

Commit

Permalink
Fix: Specify main in package.json to allow embedded usage of EAF.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoernert committed Feb 5, 2024
1 parent 1442828 commit 4c6b848
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions framework/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
node: function() {
var os = require("os");

if(typeof process.env["EAF_NODE_ID"] == 'undefined') {
process.env["EAF_NODE_ID"] = 'node_'+os.hostname();
}
const { Runner } = require("moleculer");
let runnerArgs = [];
runnerArgs.push(process.argv[0]);
runnerArgs.push(process.argv[1]);
const runner = new Runner();
runner.start(runnerArgs);

}
}
2 changes: 1 addition & 1 deletion framework/moleculer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = {

// Define a cacher.
// More info: https://moleculer.services/docs/0.14/caching.html
cacher: null,
cacher: "Memory",

// Define a serializer.
// Available values: "JSON", "Avro", "ProtoBuf", "MsgPack", "Notepack", "Thrift".
Expand Down
1 change: 1 addition & 0 deletions framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"stromdao",
"tariff"
],
"main": "./index.js",
"author": "STROMDAO GmbH <dev@stromdao.com>",
"license": "Apache-2.0",
"bugs": {
Expand Down
1 change: 1 addition & 0 deletions framework/services/api-eaf.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const ApiGateway = require("moleculer-web");
module.exports = {
name: "api-eaf",
mixins: [ApiGateway],
cacher: "Memory",

/** @type {ApiSettingsSchema} More info about settings: https://moleculer.services/docs/0.14/moleculer-web.html */
settings: {
Expand Down

0 comments on commit 4c6b848

Please sign in to comment.