-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
################# | ||
## WebStorm | ||
################# | ||
|
||
.idea/* | ||
|
||
################# | ||
## Visual Studio | ||
################# | ||
*.sln | ||
supplyCONNECT.v12.suo | ||
furry-octo-ironman.njsproj | ||
furry-octo-ironman.sln | ||
furry-octo-ironman.v12.suo | ||
.vscode/* | ||
|
||
################# | ||
## Mac | ||
################# | ||
.DS_Store | ||
|
||
|
||
############ | ||
## Windows | ||
############ | ||
|
||
# Windows image file caches | ||
Thumbs.db | ||
|
||
# Folder config file | ||
Desktop.ini | ||
|
||
############ | ||
## Node | ||
############ | ||
|
||
node_modules/ | ||
npm-debug.log | ||
|
||
############ | ||
## Configuration | ||
############ | ||
config/development.js | ||
config/production.js | ||
config/runtime.json | ||
|
||
############ | ||
## Misc | ||
############ | ||
test/out/ | ||
logs/*.log | ||
*.pst | ||
/test/selenium | ||
doc/ | ||
content/locales/en_US.json | ||
compile.bat | ||
.ntvs_analysis.dat | ||
tmp/template.html | ||
gitReset.bat | ||
mockCB.bat | ||
importDemand.bat | ||
demandmocker.js | ||
demandMocks.json | ||
projectFilesBackup/ | ||
content/shared/public/monkeynaut/ | ||
.vscode | ||
content/shared/public/css/*.css | ||
/test/coverage |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* jshint node: true */ | ||
'use strict'; | ||
|
||
const throng = require('throng'); | ||
|
||
var WORKERS = process.env.WEB_CONCURRENCY || 1; | ||
var PORT = process.env.PORT || 8001; | ||
|
||
// throng({ | ||
// workers: WORKERS, | ||
// lifetime: Infinity, | ||
// start: startApp | ||
// }); | ||
|
||
throng(start); | ||
|
||
function start() { | ||
console.log('started'); | ||
} | ||
|
||
function startApp() { | ||
var express = require('express'); | ||
var crypto = require('crypto'); | ||
var app = express(); | ||
|
||
app.listen(PORT, onListen); | ||
// app | ||
// .get('/cpu', cpuBound) | ||
// .get('/memory', memoryBound) | ||
// .get('/io', ioBound) | ||
// .listen(PORT, onListen); | ||
|
||
// function cpuBound(req, res, next) { | ||
// var key = Math.random() < 0.5 ? 'ninjaturtles' : 'powerrangers'; | ||
// var hmac = crypto.createHmac('sha512WithRSAEncryption', key); | ||
// var date = Date.now() + ''; | ||
// hmac.setEncoding('base64'); | ||
// hmac.end(date, function() { | ||
// res.send('A hashed date for you! ' + hmac.read()); | ||
// }); | ||
// } | ||
// | ||
// function memoryBound(req, res, next) { | ||
// var hundredk = new Array(100 * 1024).join('X'); | ||
// setTimeout(function sendResponse() { | ||
// res.send('Large response: ' + hundredk); | ||
// }, 20).unref(); | ||
// } | ||
// | ||
// function ioBound(req, res, next) { | ||
// setTimeout(function SimulateDb() { | ||
// res.send('Got response from fake db!'); | ||
// }, 300).unref(); | ||
// } | ||
|
||
function onListen() { | ||
console.log('Listening on', PORT); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
var express = require('express'); | ||
var cluster = require('cluster'); | ||
var os = require('os');//no need to download anything | ||
|
||
var PORT = process.env.PORT || 8001; | ||
|
||
if(cluster.isMaster) { | ||
var numWorkers = os.cpus().length; | ||
console.log('Master cluster setting up ' + numWorkers + ' workers...'); | ||
|
||
for(var i = 0; i < numWorkers; i++) { | ||
cluster.fork(); | ||
} | ||
|
||
cluster.on('online', function(worker) { | ||
console.log('Worker ' + worker.process.pid + ' is online'); | ||
}); | ||
|
||
cluster.on('exit', function(worker, code, signal) { | ||
console.log('Worker ' + worker.process.pid + ' died with code: ' + code + ', and signal: ' + signal); | ||
console.log('Starting a new worker'); | ||
cluster.fork(); | ||
}); | ||
} else { | ||
var app = require('express')(); | ||
|
||
app.listen(PORT, function() { | ||
console.log('Express server listening on %d, in %s mode', PORT, app.get('env')); | ||
}); | ||
|
||
// // Start server | ||
// server.listen(config.port, config.ip, function () { | ||
// console.log('Express server listening on %d, in %s mode', config.port, app.get('env')); | ||
// }); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.