From d863e39eccb72d2cad8e2977f7dfdf2432f375b2 Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Wed, 7 Jun 2017 10:52:19 +0100 Subject: [PATCH] Initial create --- .editorconfig | 32 +++++++++ .gitignore | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++ .jscsrc | 46 +++++++++++++ .jshintrc | 37 +++++++++++ fonts.list | 3 + package.json | 21 ++++++ server.js | 8 +++ 7 files changed, 327 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 .jscsrc create mode 100644 .jshintrc create mode 100644 fonts.list create mode 100644 package.json create mode 100644 server.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e86f5fa --- /dev/null +++ b/.editorconfig @@ -0,0 +1,32 @@ +; http://editorconfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = space +indent_size = 2 + +[*.txt] +insert_final_newline = false +trim_trailing_whitespace = false + +[*.py] +indent_size = 4 + +[*.m] +indent_size = 4 + +[Makefile] +indent_style = tab +indent_size = 8 + +[*.{js,json}] +indent_style = space +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3b6a41e --- /dev/null +++ b/.gitignore @@ -0,0 +1,180 @@ +# Created by .ignore support plugin (hsz.mobi) +### Archives template +# It's better to unpack these files and commit the raw source because +# git has its own built in compression methods. +*.7z +*.jar +*.rar +*.zip +*.gz +*.bzip +*.bz2 +*.xz +*.lzma +*.cab + +#packing-only formats +*.iso +*.tar + +#package management formats +*.dmg +*.xpi +*.gem +*.egg +*.deb +*.rpm +*.msi +*.msm +*.msp +### Windows template +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk +### OSX template +.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 + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio + +*.iml + +## Directory-based project format: +.idea/ +# if you remove the above rule, at least ignore the following: + +# User-specific stuff: +# .idea/workspace.xml +# .idea/tasks.xml +# .idea/dictionaries + +# Sensitive or high-churn files: +# .idea/dataSources.ids +# .idea/dataSources.xml +# .idea/sqlDataSources.xml +# .idea/dynamic.xml +# .idea/uiDesigner.xml + +# Gradle: +# .idea/gradle.xml +# .idea/libraries + +# Mongo Explorer plugin: +# .idea/mongoSettings.xml + +## File-based project format: +*.ipr +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +### Node template +# 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 + +# 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 directory +# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git +node_modules +bower_components + +### VisualStudioCode template +.settings + +### Xcode template +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate + +dist diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 0000000..480fcc4 --- /dev/null +++ b/.jscsrc @@ -0,0 +1,46 @@ +{ + "disallowKeywords": ["with"], + "disallowKeywordsOnNewLine": ["else"], + "disallowMixedSpacesAndTabs": true, + "disallowMultipleVarDecl": "exceptUndefined", + "disallowNewlineBeforeBlockStatements": true, + "disallowQuotedKeysInObjects": true, + "disallowSpaceAfterObjectKeys": true, + "disallowSpaceAfterPrefixUnaryOperators": true, + "disallowSpacesInFunction": { + "beforeOpeningRoundBrace": true + }, + "disallowSpacesInsideParentheses": true, + "disallowTrailingWhitespace": true, + "maximumLineLength": 160, + "requireCamelCaseOrUpperCaseIdentifiers": false, + "requireCapitalizedComments": true, + "requireCapitalizedConstructors": true, + "requireCurlyBraces": true, + "requireSpaceAfterKeywords": [ + "if", + "else", + "for", + "while", + "do", + "switch", + "case", + "return", + "try", + "catch", + "typeof" + ], + "requireSpaceAfterLineComment": true, + "requireSpaceAfterBinaryOperators": true, + "requireSpaceBeforeBinaryOperators": true, + "requireSpaceBeforeBlockStatements": true, + "requireSpaceBeforeObjectValues": true, + "requireSpacesInFunction": { + "beforeOpeningCurlyBrace": true + }, + "requireTrailingComma": false, + "requireEarlyReturn": false, + "validateIndentation": 2, + "validateLineBreaks": "LF", + "validateQuoteMarks": "'" +} diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..375085b --- /dev/null +++ b/.jshintrc @@ -0,0 +1,37 @@ +{ + "predef": [ + "Promise", + "$" + ], + "globals": { + "$": false, + "MicroEvent": false + }, + "node":true, + "browser": true, + "boss": true, + "curly": true, + "debug": false, + "devel": true, + "eqeqeq": true, + "evil": true, + "forin": false, + "immed": false, + "laxbreak": false, + "newcap": true, + "noarg": true, + "noempty": false, + "nonew": false, + "nomen": false, + "onevar": false, + "plusplus": false, + "regexp": false, + "undef": true, + "sub": true, + "strict": false, + "white": false, + "eqnull": true, + "esnext": true, + "unused": true, + "supernew":true +} diff --git a/fonts.list b/fonts.list new file mode 100644 index 0000000..ffe7b52 --- /dev/null +++ b/fonts.list @@ -0,0 +1,3 @@ +Ubuntu:300,400,500,700 +Ubuntu+Condensed +Material+Icons diff --git a/package.json b/package.json new file mode 100644 index 0000000..73dd05a --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "aida-server", + "version": "1.0.0", + "description": "Artificial Intelligent Digital Assistant (A.I.D.A.)", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://martind2000@gitlab.silvrtree.co.uk/martind2000/Aida-Server.git" + }, + "author": "", + "license": "ISC", + "devDependencies": { + "express": "^4.15.3" + }, + "dependencies": { + "node-lifx": "^0.8.0" + } +} diff --git a/server.js b/server.js new file mode 100644 index 0000000..06be6b2 --- /dev/null +++ b/server.js @@ -0,0 +1,8 @@ +/** + * Created by mdonnel on 07/06/2017. + */ + +var express = require('express'); +var path = require('path'); +var http = require('http'); +