forked from MissionSung/actionhero
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3bf8c8
commit f43601b
Showing
11 changed files
with
289 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// load in the actionHero class | ||
var actionHero = require(__dirname + "/../api.js").actionHero; // normally if installed by npm: var actionHero = require("actionHero").actionHero; | ||
|
||
// if there is no config.js file in the application's root, then actionHero will load in a collection of default params. You can overwrite them with params.configChanges | ||
var params = {}; | ||
params.configChanges = { | ||
|
||
"webServerPort" : 8080, | ||
"socketServerPort" : 5000, | ||
|
||
"logFile" : "api_peer_1.log", | ||
|
||
"actionCluster": { | ||
"Key" : "4ijhaijhm43yjnawhja43jaj", | ||
"ReConnectToLostPeersMS" : 1000, | ||
"CycleCheckTimeMS" : 100, | ||
"remoteTimeoutWaitMS" : 10000, | ||
"nodeDuplication" : 2, | ||
"StartingPeer" : { | ||
"host": null, | ||
"port": null | ||
} | ||
}, | ||
|
||
"database" : { | ||
"type":"mySQL", | ||
"host" : "127.0.0.1", | ||
"database" : "action_hero_api", | ||
"username" : "root", | ||
"password" : null, | ||
"port" : "3306", | ||
"consoleLogging" : false | ||
} | ||
} | ||
|
||
// any additional functions you might wish to define to be globally accessable can be added as part of params.initFunction. The api object will be availalbe. | ||
params.initFunction = function(api, next){ | ||
api.showCacheData = function(api){ | ||
api.log("--------- CACHE --------"); | ||
api.log(JSON.stringify(api.cache.data)); | ||
setTimeout(api.showCacheData, 5000, api); | ||
} | ||
setTimeout(api.showCacheData, 5000, api); | ||
|
||
next(); | ||
} | ||
|
||
// start the server! | ||
actionHero.start(params, function(api){ | ||
api.log("Boot Sucessful!"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// load in the actionHero class | ||
var actionHero = require(__dirname + "/../api.js").actionHero; // normally if installed by npm: var actionHero = require("actionHero").actionHero; | ||
|
||
// if there is no config.js file in the application's root, then actionHero will load in a collection of default params. You can overwrite them with params.configChanges | ||
var params = {}; | ||
params.configChanges = { | ||
|
||
"webServerPort" : 8083, | ||
"socketServerPort" : 5003, | ||
|
||
"logFile" : "api_peer_4.log", | ||
|
||
"actionCluster": { | ||
"Key" : "4ijhaijhm43yjnawhja43jaj", | ||
"ReConnectToLostPeersMS" : 1000, | ||
"CycleCheckTimeMS" : 100, | ||
"remoteTimeoutWaitMS" : 10000, | ||
"nodeDuplication" : 2, | ||
"StartingPeer" : { | ||
"host": "127.0.0.1", | ||
"port": "5000" | ||
} | ||
}, | ||
|
||
"database" : { | ||
"type":"mySQL", | ||
"host" : "127.0.0.1", | ||
"database" : "action_hero_api", | ||
"username" : "root", | ||
"password" : null, | ||
"port" : "3306", | ||
"consoleLogging" : false | ||
} | ||
} | ||
|
||
// any additional functions you might wish to define to be globally accessable can be added as part of params.initFunction. The api object will be availalbe. | ||
params.initFunction = function(api, next){ | ||
api.showCacheData = function(api){ | ||
api.log("--------- CACHE --------"); | ||
api.log(JSON.stringify(api.cache.data)); | ||
setTimeout(api.showCacheData, 5000, api); | ||
} | ||
setTimeout(api.showCacheData, 5000, api); | ||
|
||
next(); | ||
} | ||
|
||
|
||
// start the server! | ||
actionHero.start(params, function(api){ | ||
api.log("Boot Sucessful!"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// load in the actionHero class | ||
var actionHero = require(__dirname + "/../api.js").actionHero; // normally if installed by npm: var actionHero = require("actionHero").actionHero; | ||
|
||
// if there is no config.js file in the application's root, then actionHero will load in a collection of default params. You can overwrite them with params.configChanges | ||
var params = {}; | ||
params.configChanges = { | ||
"database" : { | ||
"type":"mySQL", | ||
"host" : "127.0.0.1", | ||
"database" : "action_hero_api", | ||
"username" : "root", | ||
"password" : null, | ||
"port" : "3306", | ||
"consoleLogging" : false | ||
} | ||
} | ||
|
||
// any additional functions you might wish to define to be globally accessable can be added as part of params.initFunction. The api object will be availalbe. | ||
params.initFunction = function(api, next){ | ||
next(); | ||
} | ||
|
||
// start the server! | ||
actionHero.start(params, function(api){ | ||
api.log("Boot Sucessful!"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// load in the actionHero class | ||
var actionHero = require(__dirname + "/../api.js").actionHero; // normally if installed by npm: var actionHero = require("actionHero").actionHero; | ||
|
||
// if there is no config.js file in the application's root, then actionHero will load in a collection of default params. You can overwrite them with params.configChanges | ||
var params = {}; | ||
params.configChanges = { | ||
"database" : null | ||
} | ||
|
||
// any additional functions you might wish to define to be globally accessable can be added as part of params.initFunction. The api object will be availalbe. | ||
params.initFunction = function(api, next){ | ||
next(); | ||
} | ||
|
||
// start the server! | ||
actionHero.start(params, function(api){ | ||
api.log("Boot Sucessful!"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.