From 5697cf1b8e27f08e1ad03a89b6960720e330d9f2 Mon Sep 17 00:00:00 2001 From: Bruno SIMON Date: Wed, 1 Jun 2016 19:09:41 +0200 Subject: [PATCH] Init --- .gitignore | 70 +++++++++++++++++++++++++++++ app/index.js | 41 +++++++++++++++++ app/package.json | 23 ++++++++++ license.md | 21 +++++++++ readme.md | 0 site/controllers/index.js | 9 ++++ site/index.js | 31 +++++++++++++ site/package.json | 27 +++++++++++ site/public/stylesheets/style.css | 3 ++ site/views/index/index.jade | 0 test-folder/iusdhfiuhsdf | 0 test-folder/jsodfjidsf | 0 test-folder/udshfiuhsdf/iuisduhfsdf | 0 test-folder/uhuh | 3 ++ 14 files changed, 228 insertions(+) create mode 100644 .gitignore create mode 100644 app/index.js create mode 100644 app/package.json create mode 100644 license.md create mode 100644 readme.md create mode 100644 site/controllers/index.js create mode 100644 site/index.js create mode 100644 site/package.json create mode 100644 site/public/stylesheets/style.css create mode 100644 site/views/index/index.jade create mode 100644 test-folder/iusdhfiuhsdf create mode 100644 test-folder/jsodfjidsf create mode 100644 test-folder/udshfiuhsdf/iuisduhfsdf create mode 100644 test-folder/uhuh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef90c13 --- /dev/null +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/app/index.js b/app/index.js new file mode 100644 index 0000000..897bd65 --- /dev/null +++ b/app/index.js @@ -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 ); +} ); \ No newline at end of file diff --git a/app/package.json b/app/package.json new file mode 100644 index 0000000..ac80b83 --- /dev/null +++ b/app/package.json @@ -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" + } +} diff --git a/license.md b/license.md new file mode 100644 index 0000000..4cb19a0 --- /dev/null +++ b/license.md @@ -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. diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e69de29 diff --git a/site/controllers/index.js b/site/controllers/index.js new file mode 100644 index 0000000..89d9640 --- /dev/null +++ b/site/controllers/index.js @@ -0,0 +1,9 @@ +var express = require( 'express' ), + router = express.Router(); + +router.get( '/', function( request, response ) +{ + response.send( 'Hello' ); +} ); + +module.exports = router; \ No newline at end of file diff --git a/site/index.js b/site/index.js new file mode 100644 index 0000000..782b194 --- /dev/null +++ b/site/index.js @@ -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 ); diff --git a/site/package.json b/site/package.json new file mode 100644 index 0000000..7e50be0 --- /dev/null +++ b/site/package.json @@ -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" + } +} diff --git a/site/public/stylesheets/style.css b/site/public/stylesheets/style.css new file mode 100644 index 0000000..751c632 --- /dev/null +++ b/site/public/stylesheets/style.css @@ -0,0 +1,3 @@ +body { + background:#eee; +} \ No newline at end of file diff --git a/site/views/index/index.jade b/site/views/index/index.jade new file mode 100644 index 0000000..e69de29 diff --git a/test-folder/iusdhfiuhsdf b/test-folder/iusdhfiuhsdf new file mode 100644 index 0000000..e69de29 diff --git a/test-folder/jsodfjidsf b/test-folder/jsodfjidsf new file mode 100644 index 0000000..e69de29 diff --git a/test-folder/udshfiuhsdf/iuisduhfsdf b/test-folder/udshfiuhsdf/iuisduhfsdf new file mode 100644 index 0000000..e69de29 diff --git a/test-folder/uhuh b/test-folder/uhuh new file mode 100644 index 0000000..18b6a3f --- /dev/null +++ b/test-folder/uhuh @@ -0,0 +1,3 @@ +test +qsdqsd +sdfdsf \ No newline at end of file