This commit is contained in:
Bruno SIMON
2016-06-01 19:09:41 +02:00
commit 5697cf1b8e
14 changed files with 228 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
# Created by https://www.gitignore.io/api/node,osx
### Node ###
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional REPL history
.node_repl_history
### OSX ###
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
+41
View File
@@ -0,0 +1,41 @@
// Depedencies
var chokidar = require( 'chokidar' ),
path = require( 'path' ),
colors = require( 'colors' );
// Working directory
var cwd = process.cwd();
// Watcher
var watcher = chokidar.watch(
cwd,
{
ignored : /[\/\\]\./,
ignoreInitial : true
}
);
watcher.on( 'add', ( path ) =>
{
console.log( 'add:'.green.bold, path );
} );
watcher.on( 'change', ( path ) =>
{
console.log( 'change:'.green.bold, path );
} );
watcher.on( 'unlink', ( path ) =>
{
console.log( 'unlink:'.green.bold, path );
} );
watcher.on( 'addDir', ( path ) =>
{
console.log( 'addDir:'.green.bold, path );
} );
watcher.on( 'unlinkDir', ( path ) =>
{
console.log( 'unlinkDir:'.green.bold, path );
} );
+23
View File
@@ -0,0 +1,23 @@
{
"name": "code-spectator-app",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/brunosimon/code-spectactor"
},
"author": "Bruno Simon",
"license": "MIT",
"bugs": {
"url": "https://github.com/brunosimon/code-spectactor/issues"
},
"homepage": "https://github.com/brunosimon/code-spectactor",
"dependencies": {
"chokidar": "^1.5.1",
"colors": "^1.1.2"
}
}
+21
View File
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Bruno SIMON
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
View File
+9
View File
@@ -0,0 +1,9 @@
var express = require( 'express' ),
router = express.Router();
router.get( '/', function( request, response )
{
response.send( 'Hello' );
} );
module.exports = router;
+31
View File
@@ -0,0 +1,31 @@
// Dependencies
var express = require( 'express' ),
helmet = require( 'helmet' ),
http = require( 'http' ),
socket_io = require( 'socket.io' ),
colors = require( 'colors' ),
path = require( 'path' ),
ip = require( 'ip' );
// Express
var express = express();
express.use( '/codes', require( './controllers/index.js' ) )
// Server
var server = http.createServer( express ),
server_port = 3000;
// Server
server.listen( server_port, function()
{
// URL
var url = 'http://' + ip.address() + ':' + server_port;
console.log( colors.green( '---------------------------' ) );
console.log( 'server'.green.bold + ' - ' + 'started'.cyan );
console.log( 'server'.green.bold + ' - ' + url.cyan );
} );
// Socket
var io = socket_io.listen( server );
+27
View File
@@ -0,0 +1,27 @@
{
"name": "code-spectator-site",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/brunosimon/code-spectactor"
},
"author": "Bruno Simon",
"license": "MIT",
"bugs": {
"url": "https://github.com/brunosimon/code-spectactor/issues"
},
"homepage": "https://github.com/brunosimon/code-spectactor",
"dependencies": {
"colors": "^1.1.2",
"diff": "^2.2.3",
"express": "^4.13.4",
"helmet": "^2.1.0",
"ip": "^1.1.3",
"socket.io": "^1.4.6"
}
}
+3
View File
@@ -0,0 +1,3 @@
body {
background:#eee;
}
View File
View File
View File
View File
+3
View File
@@ -0,0 +1,3 @@
test
qsdqsd
sdfdsf