├── .codeclimate.yml ├── .csslintrc ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .recink.yml ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── ROADMAP.md ├── bin ├── install_precommit.sh ├── pre-commit └── travis-init.sh ├── docs ├── .eslintignore ├── .travis.yml ├── badges.md └── description.md ├── src ├── deep-helloworld │ ├── .deepignore │ ├── backend │ │ ├── resources.json │ │ └── src │ │ │ └── say-hello │ │ │ ├── create-db │ │ │ ├── Handler.es6 │ │ │ ├── bootstrap.es6 │ │ │ └── package.json │ │ │ ├── create-fs │ │ │ ├── Handler.es6 │ │ │ ├── bootstrap.es6 │ │ │ └── package.json │ │ │ └── create-msg │ │ │ ├── Handler.es6 │ │ │ ├── bootstrap.es6 │ │ │ └── package.json │ ├── data │ │ ├── models │ │ │ └── name.json │ │ └── validation │ │ │ └── name-data.js │ ├── deepkg.json │ ├── frontend │ │ ├── bootstrap.js │ │ └── view │ │ │ └── hello.html │ ├── hook.post-deploy.js │ ├── package.json │ ├── parameters.json │ └── tests │ │ └── unit │ │ ├── health.check.spec.js │ │ └── hook.post.deploy.spec.js └── deeploy.example.json └── tslint.json /.codeclimate.yml: -------------------------------------------------------------------------------- 1 | --- 2 | engines: 3 | csslint: 4 | enabled: true 5 | duplication: 6 | enabled: true 7 | config: 8 | languages: 9 | javascript: 10 | mass_threshold: 300 11 | exclude_paths: 12 | - '**/tests' 13 | eslint: 14 | enabled: true 15 | channel: "eslint-2" 16 | fixme: 17 | enabled: true 18 | ratings: 19 | paths: 20 | - "**.css" 21 | - "**.inc" 22 | - "**.js" 23 | - "**.jsx" 24 | - "**.es6" 25 | - "**.module" 26 | exclude_paths: 27 | - '**/bin' 28 | - '**/docs' 29 | - '**/test' 30 | - '**/tests' 31 | - '**/tmp' 32 | - '**/vendor' 33 | - '**/.idea' 34 | - '**.spec.js' 35 | - '**.min.js' 36 | - '**.min.css' 37 | - '**/frontend/_build/' 38 | - '**/dist' 39 | - '**/node_modules' 40 | - '**/packages' 41 | - '**/font-awesome.css' 42 | - '**/materialdesignicons.css' 43 | - '**/DeepFramework.js' 44 | - '**/deep-framework.js' 45 | - '**/src/deep-root-*' 46 | -------------------------------------------------------------------------------- /.csslintrc: -------------------------------------------------------------------------------- 1 | --exclude-exts=.min.css 2 | --ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes 3 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | bin/**/* 2 | test/**/* 3 | **/tests 4 | **/vendor 5 | tmp/**/* 6 | **.spec.js 7 | **.min.js 8 | **.min.css 9 | 10 | # third party css files 11 | **/font-awesome.css 12 | **/materialdesignicons.css 13 | 14 | # third party js file 15 | *.min.js 16 | 17 | # DeepFramework 18 | DeepFramework.js 19 | deep-framework.js 20 | 21 | ## Directory-based project format: 22 | .idea/ 23 | 24 | # Generated folders and files 25 | **/.log 26 | **/.sass-cache 27 | **/.tmp 28 | **/coverage 29 | **/coverages 30 | **/design.doc.json 31 | **/dist 32 | **/node_modules 33 | **/npm-debug.log 34 | **/packages 35 | **/quality 36 | **/reports 37 | 38 | # Dependency directory 39 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 40 | **/node_modules 41 | 42 | # Debug log from npm 43 | npm-debug.log 44 | 45 | # Compiled libraries 46 | **/compile/ 47 | **/lib.compiled/ 48 | 49 | # App specific files 50 | .parameters.json 51 | deeploy.json* 52 | deeploy.*.json 53 | 54 | *_config.json* 55 | *.provisioning.json* 56 | 57 | # Backend files 58 | **/backend/src/**/*.js 59 | **/backend/src/**/*.zip 60 | **/backend/src/**/*.sfv 61 | **/backend/src/**/_config.json 62 | 63 | # Frontend dependencies 64 | **/frontend/_build/ 65 | 66 | # Jspm config file 67 | config.core.js 68 | config.system.js 69 | config.test.js 70 | 71 | #####=== DEEP ===##### 72 | **/src/deep-root-* 73 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | env: 2 | amd: true 3 | browser: true 4 | es6: true 5 | jquery: true 6 | node: true 7 | jasmine: true 8 | mocha: true 9 | parserOptions: 10 | sourceType: module 11 | ecmaFeatures: 12 | jsx: true 13 | rules: 14 | # Possible Errors 15 | comma-dangle: [0, never] 16 | no-cond-assign: 2 17 | no-console: 0 18 | no-constant-condition: 2 19 | no-control-regex: 2 20 | no-debugger: 2 21 | no-dupe-args: 2 22 | no-dupe-keys: 2 23 | no-duplicate-case: 2 24 | no-empty: 2 25 | no-empty-character-class: 2 26 | no-ex-assign: 2 27 | no-extra-boolean-cast: 2 28 | no-extra-parens: 0 29 | no-extra-semi: 2 30 | no-func-assign: 2 31 | no-inner-declarations: [2, functions] 32 | no-invalid-regexp: 2 33 | no-irregular-whitespace: 2 34 | no-negated-in-lhs: 2 35 | no-obj-calls: 2 36 | no-regex-spaces: 2 37 | no-sparse-arrays: 2 38 | no-unexpected-multiline: 2 39 | no-unreachable: 2 40 | use-isnan: 2 41 | valid-jsdoc: 0 42 | valid-typeof: 2 43 | 44 | # Best Practices 45 | accessor-pairs: 2 46 | block-scoped-var: 0 47 | complexity: [2, 6] 48 | consistent-return: 0 49 | curly: 2 50 | default-case: 0 51 | dot-location: 0 52 | dot-notation: 0 53 | eqeqeq: 2 54 | guard-for-in: 2 55 | no-alert: 2 56 | no-caller: 2 57 | no-case-declarations: 2 58 | no-div-regex: 2 59 | no-else-return: 0 60 | no-empty-label: 0 61 | no-empty-pattern: 2 62 | no-eq-null: 2 63 | no-eval: 2 64 | no-extend-native: 2 65 | no-extra-bind: 2 66 | no-fallthrough: 2 67 | no-floating-decimal: 0 68 | no-implicit-coercion: 0 69 | no-implied-eval: 2 70 | no-invalid-this: 0 71 | no-iterator: 2 72 | no-labels: 0 73 | no-lone-blocks: 2 74 | no-loop-func: 2 75 | no-magic-number: 0 76 | no-multi-spaces: 0 77 | no-multi-str: 0 78 | no-native-reassign: 2 79 | no-new-func: 2 80 | no-new-wrappers: 2 81 | no-new: 2 82 | no-octal-escape: 2 83 | no-octal: 2 84 | no-proto: 2 85 | no-redeclare: 2 86 | no-return-assign: 2 87 | no-script-url: 2 88 | no-self-compare: 2 89 | no-sequences: 0 90 | no-throw-literal: 0 91 | no-unused-expressions: 2 92 | no-useless-call: 2 93 | no-useless-concat: 2 94 | no-void: 2 95 | no-warning-comments: 0 96 | no-with: 2 97 | radix: [2, "as-needed"] 98 | vars-on-top: 0 99 | wrap-iife: [2, "any"] 100 | yoda: 0 101 | 102 | # Strict 103 | strict: [0, global] 104 | 105 | # Variables 106 | init-declarations: 0 107 | no-catch-shadow: 2 108 | no-delete-var: 2 109 | no-label-var: 2 110 | no-shadow-restricted-names: 2 111 | no-shadow: 0 112 | no-undef-init: 2 113 | no-undef: 2 114 | no-undefined: 2 115 | no-unused-vars: [2, {args: "none"}] 116 | no-use-before-define: 2 117 | 118 | # Node.js and CommonJS 119 | callback-return: 0 120 | global-require: 1 121 | handle-callback-err: 2 122 | no-mixed-requires: 0 123 | no-new-require: 0 124 | no-path-concat: 2 125 | no-process-exit: 2 126 | no-restricted-modules: 0 127 | no-sync: 0 128 | 129 | # Stylistic Issues 130 | array-bracket-spacing: 0 131 | block-spacing: 0 132 | brace-style: 0 133 | camelcase: [2, {properties: "never"}] 134 | comma-spacing: 0 135 | comma-style: 0 136 | computed-property-spacing: 0 137 | consistent-this: 0 138 | eol-last: 2 139 | func-names: 0 140 | func-style: 0 141 | id-length: 0 142 | id-match: 0 143 | indent: [2, 2, { SwitchCase: 1 }] 144 | jsx-quotes: 0 145 | key-spacing: 0 146 | linebreak-style: 0 147 | lines-around-comment: 0 148 | max-depth: [2, 7] 149 | max-len: [2, 120, 2, {ignoreComments: true}] 150 | max-nested-callbacks: 0 151 | max-params: 0 152 | max-statements: [2, 50] 153 | new-cap: [2, {capIsNew: false}] 154 | new-parens: 0 155 | newline-after-var: 0 156 | no-array-constructor: 0 157 | no-bitwise: 2 158 | no-continue: 0 159 | no-inline-comments: 0 160 | no-lonely-if: 0 161 | no-mixed-spaces-and-tabs: 0 162 | no-multiple-empty-lines: 0 163 | no-negated-condition: 0 164 | no-nested-ternary: 0 165 | no-new-object: 0 166 | no-plusplus: 0 167 | no-restricted-syntax: 0 168 | no-spaced-func: 0 169 | no-ternary: 0 170 | no-trailing-spaces: 0 171 | no-underscore-dangle: 0 172 | no-unneeded-ternary: 0 173 | object-curly-spacing: 0 174 | one-var: 0 175 | operator-assignment: 0 176 | operator-linebreak: 0 177 | padded-blocks: 0 178 | quote-props: 0 179 | quotes: [2, single, {allowTemplateLiterals: true}] 180 | require-jsdoc: 0 181 | semi-spacing: 0 182 | semi: 0 183 | sort-vars: 0 184 | space-after-keywords: 0 185 | space-before-blocks: 0 186 | space-before-function-paren: 0 187 | space-before-keywords: 0 188 | space-in-parens: 0 189 | space-infix-ops: 0 190 | space-return-throw-case: 0 191 | space-unary-ops: 0 192 | spaced-comment: 0 193 | wrap-regex: 0 194 | 195 | # ECMAScript 6 196 | arrow-body-style: 0 197 | arrow-parens: 0 198 | arrow-spacing: 0 199 | constructor-super: 0 200 | generator-star-spacing: 0 201 | no-arrow-condition: 0 202 | no-class-assign: 0 203 | no-const-assign: 0 204 | no-dupe-class-members: 0 205 | no-this-before-super: 0 206 | no-var: 0 207 | object-shorthand: 0 208 | prefer-arrow-callback: 0 209 | prefer-const: 0 210 | prefer-reflect: 0 211 | prefer-spread: 0 212 | prefer-template: 0 213 | require-yield: 0 214 | 215 | globals: 216 | DeepFramework: true 217 | Stripe: true 218 | angular: true 219 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### JetBrains 2 | .idea/ 3 | 4 | ## File-based project format: 5 | *.ipr 6 | *.iws 7 | 8 | ## Plugin-specific files: 9 | #.jshintrc 10 | 11 | #####=== OSX ===##### 12 | .DS_Store 13 | .AppleDouble 14 | .LSOverride 15 | 16 | # mpeltonen/sbt-idea plugin 17 | .idea_modules/ 18 | 19 | # JIRA plugin 20 | atlassian-ide-plugin.xml 21 | 22 | # Crashlytics plugin (for Android Studio and IntelliJ) 23 | com_crashlytics_export_strings.xml 24 | crashlytics.properties 25 | crashlytics-build.properties 26 | 27 | # Byte-compiled / optimized / DLL files 28 | __pycache__/ 29 | *.py[cod] 30 | 31 | # C extensions 32 | *.so 33 | 34 | # Distribution / packaging 35 | .Python 36 | env/ 37 | build/ 38 | develop-eggs/ 39 | dist/ 40 | downloads/ 41 | eggs/ 42 | .eggs/ 43 | 44 | package/ 45 | packages/ 46 | lib64/ 47 | parts/ 48 | sdist/ 49 | var/ 50 | *.egg-info/ 51 | .installed.cfg 52 | *.egg 53 | 54 | # PyInstaller 55 | # Usually these files are written by a python script from a template 56 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 57 | *.manifest 58 | *.spec 59 | 60 | # Installer logs 61 | pip-log.txt 62 | pip-delete-this-directory.txt 63 | 64 | # Translations 65 | *.mo 66 | *.pot 67 | 68 | # Django stuff: 69 | *.log 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | #Vendor 78 | vendor/ 79 | 80 | .sass-cache/ 81 | 82 | .cfg.deeploy.json 83 | .cfg.deeploy.json.production 84 | .cfg.deeploy.json.local 85 | 86 | deeploy.json 87 | deeploy.json.production 88 | deeploy.json.local 89 | 90 | .parameters.json 91 | 92 | _test/ 93 | 94 | #### joe made this: https://goel.io/joe 95 | 96 | #####=== Node ===##### 97 | 98 | # Logs 99 | logs 100 | *.log 101 | 102 | # Runtime data 103 | pids 104 | *.pid 105 | *.seed 106 | 107 | # Directory for instrumented libs generated by jscoverage/JSCover 108 | lib-cov 109 | 110 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 111 | .grunt 112 | 113 | # node-waf configuration 114 | .lock-wscript 115 | 116 | # Compiled binary addons (http://nodejs.org/api/addons.html) 117 | build/Release 118 | 119 | # Dependency directory 120 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 121 | **/node_modules 122 | **/src/deep-root-vanilla 123 | **/compile 124 | 125 | # Debug log from npm 126 | npm-debug.log 127 | 128 | # Transpiled Lambdas code 129 | **/backend/src/**/*.js 130 | **/backend/src/**/_async_config.json 131 | 132 | # Lambda archives and checksums 133 | **/backend/src/**/*.zip 134 | **/backend/src/**/*.sfv 135 | **/backend/src/**/_config.json 136 | 137 | # Frontend dependencies 138 | **/js/vendor/ 139 | **/frontend/vendor/ 140 | **/frontend/js/lib/deep-framework.js 141 | 142 | # Tests resources 143 | coverage 144 | coverages 145 | .coverage.* 146 | coverage.lcov 147 | 148 | shared-lib 149 | !backend/shared-lib 150 | # Provisioning Config files 151 | *.provisioning.json 152 | *.provisioning.json.bck 153 | -------------------------------------------------------------------------------- /.recink.yml: -------------------------------------------------------------------------------- 1 | --- 2 | $: 3 | preprocess: 4 | '$.coverage.compare.storage.options.1.region': 'eval' 5 | '$.coverage.compare.storage.options.1.accessKeyId': 'eval' 6 | '$.coverage.compare.storage.options.1.secretAccessKey': 'eval' 7 | '$.cache.options.1.region': 'eval' 8 | '$.cache.options.1.accessKeyId': 'eval' 9 | '$.cache.options.1.secretAccessKey': 'eval' 10 | '$.codeclimate.token': 'eval' 11 | '$.snyk.token': 'eval' 12 | cache: 13 | driver: 's3' 14 | options: 15 | - 's3://travis-metadata/cache/MitocGroup/deep-microservices-helloworld' 16 | - 17 | region: 'process.env.AWS_DEFAULT_REGION' 18 | accessKeyId: 'process.env.AWS_ACCESS_KEY_ID' 19 | secretAccessKey: 'process.env.AWS_SECRET_ACCESS_KEY' 20 | npm: 21 | scripts: [] 22 | emit: 23 | pattern: 24 | - /.+\.js$/i 25 | ignore: 26 | - /^(.*\/)?backend(\/?$)?/i 27 | - /^(.*\/)?frontend(\/?$)?/i 28 | - /^(.*\/)?node_modules(\/?$)?/i 29 | test: 30 | mocha: 31 | options: 32 | check-leaks: true 33 | retries: 2 34 | pattern: 35 | - /.+\.spec\.js$/i 36 | ignore: ~ 37 | coverage: 38 | pattern: 39 | - /.+\.js$/i 40 | ignore: 41 | - /.+\.spec\.js$/i 42 | reporters: 43 | text-summary: ~ 44 | lcovonly: 45 | file: ./coverage.lcov 46 | compare: 47 | negative-delta: 1 48 | storage: 49 | driver: 's3' 50 | options: 51 | - 's3://travis-metadata/coverage/MitocGroup/deep-microservices-helloworld' 52 | - 53 | region: 'process.env.AWS_DEFAULT_REGION' 54 | accessKeyId: 'process.env.AWS_ACCESS_KEY_ID' 55 | secretAccessKey: 'process.env.AWS_SECRET_ACCESS_KEY' 56 | codeclimate: 57 | token: 'process.env.CODECLIMATE_REPO_TOKEN' 58 | snyk: 59 | token: 'process.env.SNYK_API_TOKEN' 60 | 61 | ### Add other modules here... 62 | test-microservice: 63 | root: src/deep-helloworld 64 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | dist: trusty 3 | git: 4 | depth: 1 5 | cache: 6 | edge: true 7 | directories: 8 | - node_modules 9 | - "$(npm root -g)" 10 | - "$(npm config get prefix)/bin" 11 | branches: 12 | only: 13 | - master 14 | - stage 15 | - test 16 | - dev 17 | env: 18 | global: 19 | # CODECLIMATE_REPO_TOKEN=[secure] 20 | - secure: "Cmm5G3r6R/jnA9RnvJTpU7FJE4tMw/MJ+3W5pz+ncMsDA+BGbe0W4HWxgxJbGdJmG0NKBGcw8u0raT2XuzoekMQhWXYZYjEbMtmnQKwBHBSkRZcWuE+/BWFq3bbiJt0MHrWZU64wNX8b+Yq7kPlIZns2ZKwLLxpLbR2p4xRm+5RkFwv9rLV5ckBs13yOsj62XsT3gfgC/IxmhnOsqxAcsPA65q2VZt4HKCpXV3fbUyzQ3UoMgkHYaXe1JVdCR75fgupN8M097u72sePsF1a9QnriWPcNJtctwej4JUpJ48VpR0HFk3BJ+iriKaVsiRBUGaZrHOfni4BswbRH/bg+zB5pXnoxtJf97jiCuErNXpSak4w0Q4WuaqzqjhBbg5cHgSakts83CS6voZKfW+5jT+vj80QHOOB7KdyKUBHJT33060J6dlM2QawIygx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Bn+3sx7+4th8a4uhHr8PMhrvR4QLKkkkHEMBpYXtj05BdytYjifmatsAR7g5IbdU7yGKNYD4Sl0Zi08oHvwRgR3HkN7DjJH+JatvD2h3RK8+76nBoN5lLmOj+bLtYcVslCmeguotr+r3Bvq3o3zbIpTnL60o026YnNdqxOxNOCnb1i6CEwGmsYEKWPi2Dg9M4VidzmSgzzi7oNQipINv6PxgM3+v93TWHICP3eMokqFwFI=" 27 | # AWS_SECRET_ACCESS_KEY=[secure] 28 | - secure: "BBcLjEgElIGu0t+GYgJ4s4d62HUKIs45uyrXLEFaC8Tj93EA4s13Tei30h9m+BwiHG9FKDbOXfckMYDw/1O7DCss4ppisNss9ULwojuBUhB9RiZBYqFlvBEhXJRAH4Hc/EInGj9/etKd5vDzTwrb7fOSB/L+ZqYivW0Db2zZLf9G6qaCCuoyJWMAqQpPrQ0bY7KRUcMYJbylPFPNbwcbiVhTrQZ6VdFv0Sipnrj/ZLhBJym+W0SRSSO1IktCivJX//WrIUpdY2RfjD4rcg+85hIrJi7tsCi/g2ymqNJwVJhBBqvy4ijDW0nAYNRt54J9JYIPVeM45Mhi6oBBQn5CD+6erdmDI93wSf0rXVd8ONTG7/aj8pbpwfS/EfUOXh4g2DF1EOH4u5DTjg3Jn8RHoDuGWenUUIKURkGS/avnh1nM20vrfwkmaCa0oqsWA2y7CVfaZBOJ40GsPLNxXxT383RrlbcFAXqPknjmJSudPYp5Se9hEFf6fOEkjdBb4GvDBbCk9o2jDdDHIXn/0QWbtpWvI0pJHRWXbHrHeUYwzpiBKuP5LkX1rQYr8Sn0jA6UwXfy2ZGJYdsnNgmxEWSlHdgCyjzfpqRYtLu+xpo2gwjenmJfd4GhQJ2ylxMb2qllOTmVAenAiHYloHeFrZLr/E5MyEcopoQG9ZdqzQUlI/k=" 29 | 30 | stage: "Run Unit Tests :clipboard:" 31 | node_js: 32 | - 6 33 | - 8 34 | before_install: 35 | - bash bin/travis-init.sh 36 | script: 37 | - recink run unit -c recink-codeclimate -c recink-snyk 38 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing to deep-microservices-helloworld 2 | ============================================= 3 | 4 | This project is open source, and we encourage developers to contribute. Here below is the easiest way to do so: 5 | 6 | 1. [Fork](http://help.github.com/forking/) this repository in GitHub. 7 | 2. Develop the feature in your repository. Make one or more commits to your repository in GitHub. 8 | 3. Perform a [pull request](http://help.github.com/pull-requests/) from your repository back into original repository in GitHub. 9 | 10 | Make sure you update `package.json` (or `deepkg.json`, depends on the use case) and put your name and contact information in contributors section. We would like to recognize the work and empower every contributor in creative ways :) 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Mitoc Group Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | deep-microservices-helloworld 2 | ============================= 3 | 4 | [](https://travis-ci.org/MitocGroup/deep-microservices-helloworld) 5 | [](https://codeclimate.com/github/MitocGroup/deep-microservices-helloworld) 6 | 7 | deep-microservices-helloworld is a very simple microservice designed to illustrate the basic syntax for 8 | constructing a web application built of top of [DEEP Framework](https://github.com/MitocGroup/deep-framework). 9 | This repository is open sourced to show case how developers can build and deploy hassle-free cloud-native 10 | web applications using microservices architecture and serverless computing. 11 | 12 | 13 | ## Getting Started 14 | 15 | ### Step 1. Pre-requisites 16 | 17 | - [x] [Create an Amazon Web Services account](https://www.youtube.com/watch?v=WviHsoz8yHk) 18 | - [x] [Configure AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) 19 | - [x] [Get Started - Installing Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) 20 | - [x] [JDK 8 and JRE 8 Installation Start Here](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html) 21 | - [x] [Install nvm](https://github.com/creationix/nvm#install-script) and [use node v6.10+](https://github.com/creationix/nvm#usage) 22 | - [ ] Install DEEP CLI, also known as `deepify`: 23 | 24 | ```bash 25 | npm install deepify -g 26 | ``` 27 | 28 | > If you want to use `deepify` on Windows, please follow the steps from 29 | [Windows Configuration](https://github.com/MitocGroup/deep-framework/blob/master/docs/windows.md) 30 | before running `npm install deepify -g` and make sure all `npm` and `deepify` commands are executed 31 | inside Git Bash. 32 | 33 | ### Step 2. Install Microservice(s) Locally 34 | 35 | ```bash 36 | deepify install github://MitocGroup/deep-microservices-helloworld ~/deep-microservices-helloworld 37 | ``` 38 | 39 | > Path parameter in all `deepify` commands is optional and if not specified, assumes current 40 | working directory. Therefore you can skip `~/deep-microservices-helloworld` by executing 41 | `mkdir ~/deep-microservices-helloworld && cd ~/deep-microservices-helloworld` before `deepify install`. 42 | 43 | ### Step 3. Run Microservice(s) in Development 44 | 45 | ```bash 46 | deepify server ~/deep-microservices-helloworld -o 47 | ``` 48 | 49 | > When this step is finished, you can open in your browser the link *http://localhost:8000* 50 | and enjoy the deep-microservices-helloworld running locally. 51 | 52 | ### Step 4. Deploy Microservice(s) to Production 53 | 54 | ```bash 55 | deepify deploy ~/deep-microservices-helloworld 56 | ``` 57 | 58 | > Amazon CloudFront distribution takes up to 20 minutes to provision, therefore don’t worry 59 | if it returns an HTTP error in the first couple of minutes. 60 | 61 | ### Step 5. Remove Microservice(s) from Production 62 | 63 | ```bash 64 | deepify undeploy ~/deep-microservices-helloworld 65 | ``` 66 | 67 | > Amazon CloudFront distribution takes up to 20 minutes to unprovision. That's why `deepify` 68 | command checks every 30 seconds if it's disabled and when successful, removes it from your account. 69 | 70 | 71 | ## Developer Resources 72 | 73 | Having questions related to deep-microservices-helloworld? 74 | 75 | - Ask questions: https://stackoverflow.com/questions/tagged/deep-framework 76 | - Chat with us: https://mitocgroup.slack.com/messages/general 77 | - Send an email: feedback@mitocgroup.com 78 | 79 | Interested in contributing to deep-microservices-helloworld? 80 | 81 | - Contributing: https://github.com/MitocGroup/deep-microservices-helloworld/blob/master/CONTRIBUTING.md 82 | - Issue tracker: https://github.com/MitocGroup/deep-microservices-helloworld/issues 83 | - Releases: https://github.com/MitocGroup/deep-microservices-helloworld/releases 84 | - Roadmap: https://github.com/MitocGroup/deep-microservices-helloworld/blob/master/ROADMAP.md 85 | 86 | Looking for web applications that use (or are similar to) deep-microservices-helloworld? 87 | 88 | - Hello World: https://hello.deep.mg | https://github.com/MitocGroup/deep-microservices-helloworld 89 | - Todo App: https://todo.deep.mg | https://github.com/MitocGroup/deep-microservices-todomvc 90 | - AdTechMedia: https://www.adtechmedia.io | https://github.com/AdTechMedia/adtechmedia-website 91 | 92 | 93 | ## Sponsors 94 | 95 | This repository is being sponsored by: 96 | - [Mitoc Group](https://www.mitocgroup.com) 97 | - [AdTechMedia](https://www.adtechmedia.io) 98 | 99 | This code can be used under MIT license: 100 | > See [LICENSE](https://github.com/MitocGroup/deep-microservices-helloworld/blob/master/LICENSE) for more details. 101 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | Roadmap of deep-microservices-helloworld 2 | ======================================== 3 | 4 | Our list of roadmap features and functionality, in descending order of priority: 5 | 6 | - [ ] Simplify the codebase: *Replace front-end dependency from AngularJS to VanillaJS and break down back-end into 3 separate functions* 7 | -------------------------------------------------------------------------------- /bin/install_precommit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Created by vcernomschi on 10/06/2015 4 | # 5 | 6 | path=$(cd $(dirname $0); pwd -P) 7 | npm=`which npm` 8 | eslint=`which eslint` 9 | tslint=`which tslint` 10 | 11 | if [ -z ${eslint} ]; then 12 | ${npm} -g install eslint 13 | fi 14 | 15 | if [ -z ${tslint} ]; then 16 | ${npm} -g install tslint 17 | fi 18 | 19 | if [ -f ${path}/../.git/hooks/pre-commit ]; then 20 | cp ${path}/../.git/hooks/pre-commit ${path}/../.git/hooks/pre-commit_$(date +%F-%H%M%S).bak 21 | fi 22 | 23 | cp ${path}/pre-commit ${path}/../.git/hooks/. 24 | -------------------------------------------------------------------------------- /bin/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Created by vcernomschi on 15/07/2016 4 | # 5 | 6 | STAGED_JS_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".es6\|.js$") 7 | STAGED_TS_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".ts$") 8 | 9 | if [[ "$STAGED_JS_FILES" = "" ]] && [[ "$STAGED_TS_FILES" = "" ]]; then 10 | exit 0 11 | fi 12 | 13 | PASS=true 14 | 15 | echo -e "\nValidating Javascript:\n" 16 | 17 | for JS_FILE in $STAGED_JS_FILES 18 | do 19 | eslint "$JS_FILE" 20 | 21 | if [[ "$?" == 0 ]]; then 22 | echo -e "\t\033[32mESLint Passed: $JS_FILE\033[0m" 23 | else 24 | echo -e "\t\033[41mESLint Failed: $JS_FILE\033[0m" 25 | PASS=false 26 | fi 27 | done 28 | 29 | echo -e "\nJavaScript validation complete\n" 30 | 31 | echo -e "\nValidating Typescript:\n" 32 | 33 | for TS_FILE in $STAGED_TS_FILES 34 | do 35 | tslint "$TS_FILE" 36 | 37 | if [[ "$?" == 0 ]]; then 38 | echo -e "\t\033[32mTSLint Passed: $TS_FILE\033[0m" 39 | else 40 | echo -e "\t\033[41mTSLint Failed: $TS_FILE\033[0m" 41 | PASS=false 42 | fi 43 | done 44 | 45 | echo -e "\nTypeScript validation complete\n" 46 | 47 | if ! $PASS; then 48 | echo -e "\033[41mCOMMIT FAILED:\033[0m Your commit contains files that should pass ESLint/TSLint but do not. Please fix the ESLint/TSLint errors and try again.\n" 49 | exit 1 50 | else 51 | echo -e "\033[42mCOMMIT SUCCEEDED\033[0m\n" 52 | fi 53 | 54 | exit $? -------------------------------------------------------------------------------- /bin/travis-init.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Install global packages 4 | NPM_BIN=`which npm` 5 | GLOBAL_DEPS=( 6 | deepify 7 | recink 8 | recink-snyk 9 | recink-pagespeed 10 | recink-codeclimate 11 | ); 12 | 13 | for DEP in ${GLOBAL_DEPS[@]}; do 14 | if [ ! -d "$(${NPM_BIN} root -g)/${DEP}" ]; then 15 | echo "Installing missing ${DEP}" 16 | ${NPM_BIN} install -g ${DEP} || (echo "Failed to install ${DEP}" && exit 1) 17 | fi 18 | done 19 | -------------------------------------------------------------------------------- /docs/.eslintignore: -------------------------------------------------------------------------------- 1 | #####=== DEEP ===##### 2 | **/src/deep-root-* 3 | -------------------------------------------------------------------------------- /docs/.travis.yml: -------------------------------------------------------------------------------- 1 | env: 2 | # Parallelize backend and fronted test 3 | matrix: 4 | - TEST_SUITE=backend 5 | - TEST_SUITE=frontend 6 | global: 7 | # Disable interactive user mode ### 8 | - DEEP_NO_INTERACTION=1 9 | # Set type of E2E tests. Public, private or none 10 | - E2E_TESTING=none 11 | # To enable run full CI build for specified branches 12 | - MAJOR_VERSIONS=master 13 | # JSPM_GITHUB_AUTH_TOKEN=[secure] 14 | - secure: "Hk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tcK6ruQBV8frDupsxERY2HQkkRPlh7CGd2jExgbw4L8D8V8sC5akGchug+gpdsoVdrQPfxmeyM80nLtCHL15MUp79yhHxYSBPLoMNSK7DRpYR6y2paK1u+NhBxQva/Z87IqrkBE2iNfw6jGFT8iJYuERiznM+1nP7ABI9u6U78teyoq+TulIIO9BAI97vnKjUoSH79go036VHJqX04BU+4zW/NxpAOGcWwffhWglIy69XUQvhdpOFqTR1ks+i5gsTk/j0/R6UsoUZVkfSz710rGEyEYqWmnnoQOBtBB+hezpTRIXPE/pYFI7jytU5rceY3BLIdig=" 29 | notifications: 30 | # Send notifications to Slack 31 | slack: 32 | secure: "nPGEFw9t83TDW7oubn6jfIh+T710qnpaE7Oax4W7X63OO5Qvf6Igr4y5XKF2DARGBZ9l5rFENm7WurfvzoLIwXzHONm4Da9rAzaIYCPNUPRfDU2iAtAN9VyUedow4G0/ZhAh94OWAj+ma/803zYp899IjjVn6JxtCfGZYsfrK95Fb14nC+s6oXjzZsl2+QP4dbJklFKrk9W0o0ps3KDEpzePgG4pVU+M4HMndYkc3UAqQUJ7+Ilsp2WkcGubX7jP6sjNe/iIseZepsxzrY7Q+TvzSljq+pNkPkj2MLfK0VUWWI7twd0cNVFfOKX5eUhA6GMKBQAoK7RT8MSqVhtgUcL5kgqKuUIyLq76g2PQo2+PIhmsBkSI5M6xR9SJvchHtEKuPEzqK4hNsilyUkSnlwsREwq2Q8f6HgSe0GHAXxuO4saAky/RECQiBnoDds3yaYc06jP00MyIkIgX2VJKLZ4si9cpTFrnIzPjZrMBx4/fTXx20cIQtACFKr49/4rJHwwCeiJW0lZnRpbCzPx2Sr4a36eFReQLW5hnJgLUumgqexc5Ae4ygZWPYR4+7N/wi16ld4ubpUqLHAYEujRPjiSuvvwZ1xpUH91LLP+ywRPa5jAocYYWchjTnjhzumQ8+QcMItgZDYyGYu3ZFJzcvpc46ZLVk4Z3n7z8tQh111k=" 33 | -------------------------------------------------------------------------------- /docs/badges.md: -------------------------------------------------------------------------------- 1 | [](https://travis-ci.org/MitocGroup/deep-microservices-helloworld) 2 | [](https://codeclimate.com/repos/5798cf9cd42af178f8002e8b/coverage) 3 | 4 | -------------------------------------------------------------------------------- /docs/description.md: -------------------------------------------------------------------------------- 1 | deep-microservices-helloworld is a very simple microservice designed to illustrate the basic syntax for 2 | constructing a web application built of top of [DEEP Framework](https://github.com/MitocGroup/deep-framework). 3 | This repository is open sourced to show case how developers can build and deploy hassle-free cloud-native 4 | web applications using microservices architecture and serverless computing. 5 | 6 | -------------------------------------------------------------------------------- /src/deep-helloworld/.deepignore: -------------------------------------------------------------------------------- 1 | tests/* 2 | .* 3 | *.es6 4 | -------------------------------------------------------------------------------- /src/deep-helloworld/backend/resources.json: -------------------------------------------------------------------------------- 1 | { 2 | "say-hello": { 3 | "create-msg": { 4 | "description": "Says hello to the world", 5 | "type": "lambda", 6 | "validationSchema": "name-data", 7 | "methods": ["POST"], 8 | "source": "src/say-hello/create-msg" 9 | }, 10 | "create-fs": { 11 | "description": "Says hello to the world", 12 | "type": "lambda", 13 | "validationSchema": "name-data", 14 | "methods": ["POST"], 15 | "source": "src/say-hello/create-fs" 16 | }, 17 | "create-db": { 18 | "description": "Says hello to the world", 19 | "type": "lambda", 20 | "validationSchema": "name-data", 21 | "methods": ["POST"], 22 | "source": "src/say-hello/create-db" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/deep-helloworld/backend/src/say-hello/create-db/Handler.es6: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import DeepFramework from 'deep-framework'; 4 | 5 | export default class extends DeepFramework.Core.AWS.Lambda.Runtime { 6 | /** 7 | * @param {*} args 8 | */ 9 | constructor(...args) { 10 | super(...args); 11 | } 12 | 13 | /** 14 | * @param {Object} request 15 | */ 16 | handle(request) { 17 | let db = this.kernel.get('db'); 18 | 19 | db.get('Name').createItem(request, (error, nameModel) => { 20 | if (error) { 21 | this.createError(error).send(); 22 | } else { 23 | this.createResponse({ 24 | db: nameModel.get() 25 | }).send(); 26 | } 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/deep-helloworld/backend/src/say-hello/create-db/bootstrap.es6: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import DeepFramework from 'deep-framework'; 4 | import Handler from './Handler'; 5 | 6 | export default DeepFramework.LambdaHandler(Handler); 7 | -------------------------------------------------------------------------------- /src/deep-helloworld/backend/src/say-hello/create-db/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "say-hello-create-db", 3 | "version": "0.0.1", 4 | "description": "Lambda that says hello to the world", 5 | "keywords": [ 6 | "DEEP", 7 | "Digital Enterprise End-To-End Platform", 8 | "Hello World" 9 | ], 10 | "homepage": "https://github.com/MitocGroup/deep-microservices-helloworld", 11 | "bugs": { 12 | "url": "https://github.com/MitocGroup/deep-microservices-helloworld/issues" 13 | }, 14 | "license": "MIT", 15 | "author": { 16 | "name": "Mitoc Group", 17 | "email": "hello@mitocgroup.com", 18 | "website": "www.mitocgroup.com" 19 | }, 20 | "contributors": [ 21 | { 22 | "name": "DEEP Dev Team", 23 | "email": "hello@deep.mg", 24 | "website": "www.deep.mg" 25 | } 26 | ], 27 | "repository": { 28 | "type": "git", 29 | "url": "https://github.com/MitocGroup/deep-microservices-helloworld.git" 30 | }, 31 | "scripts": { 32 | "postinstall": "npm run compile", 33 | "compile": "deepify compile es6 `pwd`" 34 | }, 35 | "dependencies": { 36 | "deep-framework": "^1.x.x" 37 | }, 38 | "devDependencies": { 39 | }, 40 | "private": true 41 | } 42 | -------------------------------------------------------------------------------- /src/deep-helloworld/backend/src/say-hello/create-fs/Handler.es6: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import url from 'url'; 4 | import DeepFramework from 'deep-framework'; 5 | 6 | export default class extends DeepFramework.Core.AWS.Lambda.Runtime { 7 | /** 8 | * @param {*} args 9 | */ 10 | constructor(...args) { 11 | super(...args); 12 | 13 | this._fs = this.kernel.get('fs'); 14 | } 15 | 16 | /** 17 | * @param {Object} request 18 | */ 19 | handle(request) { 20 | let fileName = `request_payload_${(new Date()).getTime()}`; 21 | 22 | this._fs.public.writeFile(fileName, JSON.stringify(request), (error, meta) => { 23 | if (error) { 24 | this.createError(error).send(); 25 | } else { 26 | this.createResponse({ 27 | fs: fileName, 28 | link: this._getFileLink(fileName) 29 | }).send(); 30 | } 31 | }); 32 | } 33 | 34 | /** 35 | * 36 | * @param {String} fileName 37 | * @returns {String} 38 | * @private 39 | */ 40 | _getFileLink(fileName) { 41 | let s3fs = this._fs.public; 42 | 43 | if (this._fs.localBackend) { 44 | return s3fs.getPath(fileName); 45 | } 46 | 47 | return url.resolve( 48 | s3fs.s3.endpoint.href, 49 | s3fs.getPath(fileName) 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/deep-helloworld/backend/src/say-hello/create-fs/bootstrap.es6: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import DeepFramework from 'deep-framework'; 4 | import Handler from './Handler'; 5 | 6 | export default DeepFramework.LambdaHandler(Handler); 7 | -------------------------------------------------------------------------------- /src/deep-helloworld/backend/src/say-hello/create-fs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "say-hello-create-fs", 3 | "version": "0.0.1", 4 | "description": "Lambda that says hello to the world", 5 | "keywords": [ 6 | "DEEP", 7 | "Digital Enterprise End-To-End Platform", 8 | "Hello World" 9 | ], 10 | "homepage": "https://github.com/MitocGroup/deep-microservices-helloworld", 11 | "bugs": { 12 | "url": "https://github.com/MitocGroup/deep-microservices-helloworld/issues" 13 | }, 14 | "license": "MIT", 15 | "author": { 16 | "name": "Mitoc Group", 17 | "email": "hello@mitocgroup.com", 18 | "website": "www.mitocgroup.com" 19 | }, 20 | "contributors": [ 21 | { 22 | "name": "DEEP Dev Team", 23 | "email": "hello@deep.mg", 24 | "website": "www.deep.mg" 25 | } 26 | ], 27 | "repository": { 28 | "type": "git", 29 | "url": "https://github.com/MitocGroup/deep-microservices-helloworld.git" 30 | }, 31 | "scripts": { 32 | "postinstall": "npm run compile", 33 | "compile": "deepify compile es6 `pwd`" 34 | }, 35 | "dependencies": { 36 | "deep-framework": "^1.x.x" 37 | }, 38 | "devDependencies": { 39 | }, 40 | "private": true 41 | } 42 | -------------------------------------------------------------------------------- /src/deep-helloworld/backend/src/say-hello/create-msg/Handler.es6: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import DeepFramework from 'deep-framework'; 4 | 5 | export default class extends DeepFramework.Core.AWS.Lambda.Runtime { 6 | /** 7 | * @param {*} args 8 | */ 9 | constructor(...args) { 10 | super(...args); 11 | } 12 | 13 | /** 14 | * @param {Object} request 15 | */ 16 | handle(request) { 17 | this.createResponse({ 18 | msg: `Hello ${request.Name}!`, 19 | }).send(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/deep-helloworld/backend/src/say-hello/create-msg/bootstrap.es6: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import DeepFramework from 'deep-framework'; 4 | import Handler from './Handler'; 5 | 6 | export default DeepFramework.LambdaHandler(Handler); 7 | -------------------------------------------------------------------------------- /src/deep-helloworld/backend/src/say-hello/create-msg/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "say-hello-create-msg", 3 | "version": "0.0.1", 4 | "description": "Lambda that says hello to the world", 5 | "keywords": [ 6 | "DEEP", 7 | "Digital Enterprise End-To-End Platform", 8 | "Hello World" 9 | ], 10 | "homepage": "https://github.com/MitocGroup/deep-microservices-helloworld", 11 | "bugs": { 12 | "url": "https://github.com/MitocGroup/deep-microservices-helloworld/issues" 13 | }, 14 | "license": "MIT", 15 | "author": { 16 | "name": "Mitoc Group", 17 | "email": "hello@mitocgroup.com", 18 | "website": "www.mitocgroup.com" 19 | }, 20 | "contributors": [ 21 | { 22 | "name": "DEEP Dev Team", 23 | "email": "hello@deep.mg", 24 | "website": "www.deep.mg" 25 | } 26 | ], 27 | "repository": { 28 | "type": "git", 29 | "url": "https://github.com/MitocGroup/deep-microservices-helloworld.git" 30 | }, 31 | "scripts": { 32 | "postinstall": "npm run compile", 33 | "compile": "deepify compile es6 `pwd`" 34 | }, 35 | "dependencies": { 36 | "deep-framework": "^1.x.x" 37 | }, 38 | "devDependencies": { 39 | }, 40 | "private": true 41 | } 42 | -------------------------------------------------------------------------------- /src/deep-helloworld/data/models/name.json: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "string" 3 | } 4 | -------------------------------------------------------------------------------- /src/deep-helloworld/data/validation/name-data.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(Joi) { 4 | return Joi.object().keys({ 5 | Name: Joi.string().min(2).max(255).required() 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /src/deep-helloworld/deepkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "identifier": "deep-helloworld", 3 | "name": "deep-helloworld", 4 | "description": "Example microservice that does hello world", 5 | "version": "0.0.1", 6 | "frontendEngine": ["vanilla"], 7 | "author": { 8 | "name": "Mitoc Group", 9 | "email": "hello@mitocgroup.com", 10 | "website": "http://www.mitocgroup.com" 11 | }, 12 | "contributors": [ 13 | { 14 | "name": "DEEP Dev Team", 15 | "email": "hello@deep.mg", 16 | "website": "https://www.deep.mg" 17 | } 18 | ], 19 | "dependencies": { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/deep-helloworld/frontend/bootstrap.js: -------------------------------------------------------------------------------- 1 | (function(framework) { 2 | 'use strict'; 3 | 4 | var security = framework.Kernel.get('security'); 5 | var resource = framework.Kernel.get('resource'); 6 | var asset = framework.Kernel.get('asset'); 7 | 8 | function loadAsset(assetPath, callback) { 9 | var xhttp = new XMLHttpRequest(); 10 | var realPath = asset.locate(assetPath); 11 | 12 | xhttp.onreadystatechange = function () { 13 | if (xhttp.readyState === 4 && xhttp.status === 200) { 14 | callback(xhttp.responseText); 15 | } 16 | }; 17 | 18 | xhttp.open('GET', realPath, true); 19 | xhttp.send(); 20 | } 21 | 22 | loadAsset('@deep-helloworld:view/hello.html', function(plainHtml) { 23 | var body = document.body; 24 | body.innerHTML = plainHtml; 25 | 26 | var sendBtn = body.querySelector('#send-name'); 27 | var dataTag = body.querySelector('#data'); 28 | var nameInput = body.querySelector('#name'); 29 | 30 | sendBtn.addEventListener('click', function(e) { 31 | e.preventDefault(); 32 | 33 | var payload = {Name: nameInput.value}; 34 | var checkedResource = body.querySelector('input[name="resource"]:checked'); 35 | var resourceIdentifier = '@deep-helloworld:say-hello:create-' + checkedResource.value; 36 | 37 | security.anonymousLogin(function() { 38 | resource.get(resourceIdentifier).request(payload).send(function(response) { 39 | dataTag.innerHTML = JSON.stringify(response.data, null, ' '); 40 | }); 41 | }); 42 | }); 43 | }); 44 | })(DeepFramework); 45 | -------------------------------------------------------------------------------- /src/deep-helloworld/frontend/view/hello.html: -------------------------------------------------------------------------------- 1 |