This repository has been archived by the owner on Apr 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Showing
4 changed files
with
76 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"undef": true, | ||
"strict": false, | ||
"browser": false, | ||
"loopfunc": false, | ||
"asi": false, | ||
"eqeqeq": true, | ||
"evil": false, | ||
"mootools": false, | ||
"shadow": false, | ||
"unused": false, | ||
|
||
"globals": { | ||
"console": false, | ||
"module": false, | ||
"process": false, | ||
"require": false, | ||
"setImmediate": false, | ||
"setInterval": false | ||
} | ||
} |
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,2 @@ | ||
var core = require('./lib/core'); | ||
core.start(); |
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,20 @@ | ||
var http = require('http'); | ||
var express = require('express'); | ||
var socketio = require('socket.io'); | ||
|
||
var config = require('./config'); | ||
|
||
|
||
var app = express(); | ||
app.set('port', config.web.port); | ||
|
||
function start() { | ||
var server = http.createServer(app); | ||
server.listen(app.get('port'), function() { | ||
console.log('Listening on https://0.0.0.0:{0}'.format(app.get('port'))); | ||
}); | ||
} | ||
|
||
module.exports = { | ||
start: start, | ||
}; |
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,33 @@ | ||
/* Python new-style string formatting. | ||
* > "Hello, {0}.".format('Mike'); | ||
* Hello, Mike. | ||
* > "How is the weather in {citi}?".format({city: 'Mountain View'}) | ||
* How is the weather in Mountain View? | ||
*/ | ||
String.prototype.format = function(obj) { | ||
var args = arguments; | ||
var str = this; | ||
// Support either an object, or a series. | ||
return str.replace(/\{[\w\d\._-]+\}/g, function(part) { | ||
// Strip off {}. | ||
part = part.slice(1, -1); | ||
var index = parseInt(part, 10); | ||
if (isNaN(index)) { | ||
return dottedGet(obj, part); | ||
} else { | ||
return args[index]; | ||
} | ||
}); | ||
}; | ||
|
||
function dottedGet(obj, selector) { | ||
selector = selector.split('.'); | ||
while (selector.length) { | ||
obj = obj[selector.splice(0, 1)[0]]; | ||
} | ||
return obj; | ||
} | ||
|
||
module.exports = { | ||
|
||
}; |