diff --git a/devstaff-api-node/.babelrc b/devstaff-api-node/.babelrc new file mode 100644 index 0000000..ba124fb --- /dev/null +++ b/devstaff-api-node/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} diff --git a/devstaff-api-node/.eslintrc b/devstaff-api-node/.eslintrc new file mode 100644 index 0000000..e89ba50 --- /dev/null +++ b/devstaff-api-node/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": "airbnb" +} \ No newline at end of file diff --git a/devstaff-api-node/.gitignore b/devstaff-api-node/.gitignore index b976608..3cc68db 100644 --- a/devstaff-api-node/.gitignore +++ b/devstaff-api-node/.gitignore @@ -8,7 +8,7 @@ pids lib-cov coverage .lock-wscript -build/Release +build/ node_modules ### SublimeText ### @@ -36,3 +36,85 @@ config/runtime.yaml # Runtime configuration for swagger app .jsbeautifyrc dist/ + +# Created by https://www.gitignore.io/api/macos,node,visualstudiocode,code + +### macOS ### +*.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 + + +### Node ### +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# 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 + + +### VisualStudioCode ### +.vscode + +### Code ### +# Visual Studio Code - https://code.visualstudio.com/ +.settings/ +.vscode/ +tsconfig.json +jsconfig.json \ No newline at end of file diff --git a/devstaff-api-node/README.md b/devstaff-api-node/README.md index 92135e8..98cec4f 100644 --- a/devstaff-api-node/README.md +++ b/devstaff-api-node/README.md @@ -6,9 +6,11 @@ A simple RESTful API used to view / create / edit / delete tasks. ```bash npm install -node index.js +npm build +npm start ``` ## Usage -It is suggested to use [Postman](https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en) to start making requests to your API. +It is suggested to use [Postman](https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en) to start making requests to your API. +If you wish to view the tasks rendered with React you can visit [http://localhost:3000](http://localhost:3000) \ No newline at end of file diff --git a/devstaff-api-node/package.json b/devstaff-api-node/package.json index 0609295..0a6e77f 100644 --- a/devstaff-api-node/package.json +++ b/devstaff-api-node/package.json @@ -4,7 +4,9 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "build": "babel src/index.js -d build", + "start": "node build/src/index.js" }, "author": "", "license": "ISC", @@ -14,5 +16,16 @@ "express": "^4.13.3", "lodash": "^3.10.1", "moment": "^2.10.6" + }, + "devDependencies": { + "babel": "^6.5.2", + "babel-cli": "^6.11.4", + "babel-core": "^6.11.4", + "babel-preset-es2015": "^6.9.0", + "eslint": "^3.1.1", + "eslint-config-airbnb": "^9.0.1", + "eslint-plugin-import": "^1.12.0", + "eslint-plugin-jsx-a11y": "^2.0.1", + "eslint-plugin-react": "^5.2.2" } } diff --git a/devstaff-api-node/public/App.jsx b/devstaff-api-node/public/App.jsx new file mode 100644 index 0000000..23b3dd7 --- /dev/null +++ b/devstaff-api-node/public/App.jsx @@ -0,0 +1,78 @@ +class Task extends React.Component { + + constructor() { + super(); + + this.state = {}; + } + + render() { + const task = this.props.task; + return ( +