├── .gitignore
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── api
└── todo
│ ├── .gitignore
│ ├── config.yml
│ ├── database
│ └── dynamodb.js
│ ├── handler.js
│ ├── lib
│ ├── helper.js
│ ├── response.js
│ └── todo.js
│ ├── offline
│ └── migrations
│ │ ├── todo-seed.json
│ │ └── todo.yml
│ ├── package-lock.json
│ ├── package.json
│ └── serverless.yml
├── gulpfile.js
├── package-lock.json
├── package.json
└── web
├── .gitignore
├── README.md
├── package-lock.json
├── package.json
├── public
├── favicon.ico
├── index.html
└── manifest.json
└── src
├── App.css
├── App.js
├── App.test.js
├── components
├── page-not-found.js
├── todo-component.js
└── todo
│ ├── create-todo.js
│ ├── todo-list-header.js
│ ├── todo-list-item.js
│ └── todo-list.js
├── index.css
├── index.js
└── registerServiceWorker.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | Using welcoming and inclusive language
12 | Being respectful of differing viewpoints and experiences
13 | Gracefully accepting constructive criticism
14 | Focusing on what is best for the community
15 | Showing empathy towards other community members
16 | Examples of unacceptable behavior by participants include:
17 |
18 | The use of sexualized language or imagery and unwelcome sexual attention or advances
19 | Trolling, insulting/derogatory comments, and personal or political attacks
20 | Public or private harassment
21 | Publishing others' private information, such as a physical or electronic address, without explicit permission
22 | Other conduct which could reasonably be considered inappropriate in a professional setting
23 |
24 | ## Our Responsibilities
25 |
26 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
27 |
28 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
29 |
30 | ## Scope
31 |
32 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
33 |
34 | ## Enforcement
35 |
36 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at **99xt@googlegroups.com**. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
37 |
38 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
39 |
40 | ## Attribution
41 |
42 | This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at [http://contributor-covenant.org/version/1/4](http://contributor-covenant.org/version/1/4).
43 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 99X Technology
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 | serverless-react-boilerplate
2 | ============================
3 |
4 | [](http://www.serverless.com)
5 | [](https://opensource.org/licenses/MIT)
6 | [](https://gitter.im/99xt/serverless-react-boilerplate?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7 |
8 | ## Sample Todo App
9 |
10 |
11 | ## Requirements
12 | * Java Runtime Engine (JRE) version 6.x or newer to run dynamodb locally.
13 |
14 | ## Features
15 | * Support serverless v1.26.0
16 | * Support offline development with dynamodb, lambda and API Gateway
17 | * Support local dynamodb seeds/migrations
18 | * Build automation in client and server to ease local development
19 | * Deploy to multiple API Services
20 | * Use of Environment variables
21 | * Lambda CRUD operations for a Todo application with live reload
22 | * React web application to utilize the API
23 |
24 |
25 | ## How to develop and test offline?
26 | We have used [serverless-offline plugin](https://github.com/dherault/serverless-offline) and [serverless-dynamodb-local plugin](https://github.com/99xt/serverless-dynamodb-local) in this boilerplate. You can declare your table templates and seeds in `api/todo/offline/migrations/` folder just like the `todo.json` template. When you spin up the offline server, these tables will be used as the datasources for your lambda functions.
27 |
28 | ## Production vs Offline
29 | Thanks to the offline plugin's environment variable `IS_OFFLINE` we can select between local dynamodb and aws dynamodb.
30 | ```
31 | var dynamodbOfflineOptions = {
32 | region: "localhost",
33 | endpoint: "http://localhost:8000"
34 | },
35 | isOffline = () => process.env.IS_OFFLINE;
36 |
37 | var client = isOffline() ? new AWS.DynamoDB.DocumentClient(dynamodbOfflineOptions) : new AWS.DynamoDB.DocumentClient();
38 | ```
39 |
40 | ### Directory structure
41 | ```
42 | |──api
43 | | |──todo
44 | | | |──lib
45 | | | | |──todo.js
46 | | | | |──helper.js
47 | | | | |──response.js
48 | | | |──handler.js
49 | | | |──database
50 | | | |──dynamodb.js
51 | | | |──offline
52 | | | | |──migrations
53 | | | | | |──todo.yml
54 | | | | | |──todo-seed.json
55 | | | |──config.yml
56 | | | |──serverless.yml
57 | | | |──package.json
58 | |──web
59 | | |──src
60 | | | |──components
61 | | | |──index.js
62 | | |──public
63 | | | |──index.html
64 | | |──package.json
65 | |──gulpfile.js
66 | |──package.json
67 |
68 |
69 | ```
70 | ## Installation & Usage
71 | * Clone this repo.
72 | * Make sure AWS credentials are setup properly. Otherwise refer [this document](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html)
73 | ```
74 | aws configure --profile peter
75 | ```
76 | * Add the aws cli profile name and region on to serverless.yml file located at **/api/todo/serverless.yml**
77 | ```
78 | ...
79 | provider:
80 | name: aws
81 | runtime: nodejs6.10
82 | profile: peter
83 | stage: dev
84 | region: eu-west-2
85 | ...
86 | ```
87 |
88 | * Install serverless globally
89 | ```
90 | npm i -g serverless
91 | ```
92 | * Install project dependencies. `cd serverless-react-boilerplate` and type,
93 | ```
94 | npm install
95 | ```
96 | * Install dynamodb local. (Make sure you have Java runtime 6.x or newer)
97 | ```
98 | npm run db-setup
99 | ```
100 | * Run the app with the local server
101 | ```
102 | npm run app
103 | ```
104 | * Browser will open the todo app at `http://localhost:3001`
105 |
106 | ## Deploying to AWS
107 | When you are ready to deploy your database and api to AWS, you can create multiple
108 | APIGateways for different service level stages. For example you can create "dev" and "production" stages.
109 | When you deploy to a specific stage, it will create a separate database tables for that stage.
110 |
111 | Following command will deploy your lambda functions and APIGateway onto 'prod' stage.
112 | ```
113 | cd api
114 | cd todo
115 | serverless deploy --stage prod
116 | ```
117 |
118 | If you want to test your React app with the online API and Database, you may have to change the, **BASE_URL** of the react app
119 | found in **web/src/App.js**. Change its value from **http://localhost:3000** to your **APIGateway uri**.
120 |
121 | ## Application Secrets Keys
122 | You can define application secret keys in **config.yml** file. For example if you need to have a database
123 | connection string and use it in your lambda function, define it as follows.
124 |
125 | ```
126 | prod:
127 | DB_STRING:
128 | ```
129 |
130 | Then in the serverless.yml file,
131 | ```
132 | custom:
133 | DB_STRING: ${file(./config.yml):${self:custom.stage}.DB_STRING}
134 | ```
135 | This will corretly select the DB_STRING corresponding to the defined stage.
136 |
137 | You should **NOT** commit config.yml to your version control system
138 |
139 | ## Deploying react web app
140 | Once you have setup a S3 bucket with static web hosting enabled you can simply build your react app and deploy to that bucket.
141 | Make sure to change **BASE_URL** to refer your production APIGateway endpoint.
142 |
143 | On the root level package.json file add that bucket name and your AWS profile name on the **deploy-s3** task. After that run the following command.
144 | ```
145 | npm run deploy-s3
146 | ```
147 |
148 | See following vidoes for a step by step guide to create a s3 bucket and configure static web hosting.
149 | #### [Video 01 - Hosting a website on AWS with S3, CloudFront and Route53 ](https://youtu.be/D6qB7MEFOe0)
150 | #### [Video 02 - Hosting Angular, React and Vue.js applications on AWS](https://youtu.be/f20XOaQ3JDA)
151 |
152 | ## Contribution
153 | Your contributions are much appriciated.
154 |
155 | ## Release Log
156 | * Release v4.1.0 - Updated boilerplate to support Lambda Proxy
157 | * Release v4.0.0 - Added support for serverless@1.x
158 | * Release v3.0.0 - Added environment variables for database table names & Feature to deploy in multiple APIGateway service level stages.
159 | * Release v2.2.0 - Added foundation css framework for the react client
160 | * Release v2.1.1 - Improvements in react web app
161 | * Release v2.0.1 - Dynamodb local table creation bug fix
162 | * Release v2.0.0 - Added support for serverless v1.0 and Issues #24 #25
163 | * Release v1.0.3 - Fixed local dynamobd get packaged for deployment
164 | * Release v1.0.2 - Added support for serverless@1.0.0-rc.2
165 |
166 | ## Links
167 | * [serverless-dynamodb-local plugin](https://github.com/99xt/serverless-dynamodb-local)
168 | * [serverless-offline plugin](https://github.com/dherault/serverless-offline)
169 |
170 |
171 | ## License
172 | [MIT](LICENSE)
173 |
--------------------------------------------------------------------------------
/api/todo/.gitignore:
--------------------------------------------------------------------------------
1 | # package directories
2 | node_modules
3 | jspm_packages
4 |
5 | # Serverless directories
6 | .serverless
--------------------------------------------------------------------------------
/api/todo/config.yml:
--------------------------------------------------------------------------------
1 | dev:
2 | APP_SECRET: secret_key_here
3 | DB_PREFIX: dev
4 | prod:
5 | APP_SECRET: secret_key_here
6 | DB_PREFIX: prod
--------------------------------------------------------------------------------
/api/todo/database/dynamodb.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | const Promise = require("bluebird");
4 | const AWS = require("aws-sdk");
5 |
6 | var dynamodbOfflineOptions = {
7 | region: "localhost",
8 | endpoint: "http://localhost:8000"
9 | },
10 | isOffline = () => process.env.IS_OFFLINE;
11 |
12 | var client = isOffline()
13 | ? new AWS.DynamoDB.DocumentClient(dynamodbOfflineOptions)
14 | : new AWS.DynamoDB.DocumentClient();
15 |
16 | module.exports = (method, params) => {
17 | return Promise.fromCallback(cb => client[method](params, cb));
18 | };
19 |
--------------------------------------------------------------------------------
/api/todo/handler.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | let todo = require('./lib/todo');
4 |
5 | module.exports.getAllTodos = (event, context, callback) => {
6 | todo.getAllTodos(event, callback);
7 | };
8 |
9 | module.exports.createTodo = (event, context, callback) => {
10 | todo.createTodo(event, callback);
11 | };
12 |
13 | module.exports.updateTodo = (event, context, callback) => {
14 | todo.updateTodo(event, callback);
15 | };
16 |
17 | module.exports.updateTodoStatus = (event, context, callback) => {
18 | todo.updateTodoStatus(event, callback);
19 | };
20 |
21 | module.exports.deleteTodo = (event, context, callback) => {
22 | todo.deleteTodo(event, callback);
23 | };
--------------------------------------------------------------------------------
/api/todo/lib/helper.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var Promise = require("bluebird"),
4 | db = require("../database/dynamodb");
5 |
6 | const DB_PREFIX = process.env.IS_OFFLINE ? "dev" : process.env.DB_PREFIX;
7 |
8 | function getTodo(id) {
9 | return db("query", {
10 | TableName: DB_PREFIX + "-todos",
11 | KeyConditionExpression: "#id = :id",
12 | ExpressionAttributeValues: {
13 | ":id": id
14 | },
15 | ExpressionAttributeNames: {
16 | "#id": "id"
17 | }
18 | });
19 | }
20 |
21 | function getAllTodos() {
22 | return db("scan", {
23 | TableName: DB_PREFIX + "-todos"
24 | });
25 | }
26 |
27 | function createTodo(data) {
28 | return db("put", {
29 | TableName: DB_PREFIX + "-todos",
30 | Item: {
31 | id: data.id,
32 | task: data.task,
33 | isCompleted: data.isCompleted
34 | }
35 | });
36 | }
37 |
38 | function updateTodo(data) {
39 | return db("update", {
40 | TableName: DB_PREFIX + "-todos",
41 | Key: {
42 | id: data.id
43 | },
44 | UpdateExpression: "set task = :task",
45 | ExpressionAttributeValues: {
46 | ":task": data.task
47 | }
48 | });
49 | }
50 |
51 | function updateTodoStatus(data) {
52 | return db("update", {
53 | TableName: DB_PREFIX + "-todos",
54 | Key: {
55 | id: data.id
56 | },
57 | UpdateExpression: "set isCompleted = :isCompleted",
58 | ExpressionAttributeValues: {
59 | ":isCompleted": data.isCompleted
60 | }
61 | });
62 | }
63 |
64 | function deleteTodo(params) {
65 | return db("delete", {
66 | TableName: DB_PREFIX + "-todos",
67 | Key: {
68 | id: params.id
69 | }
70 | });
71 | }
72 |
73 | module.exports = {
74 | getTodo: getTodo,
75 | getAllTodos: getAllTodos,
76 | updateTodo: updateTodo,
77 | updateTodoStatus: updateTodoStatus,
78 | createTodo: createTodo,
79 | deleteTodo: deleteTodo
80 | };
81 |
--------------------------------------------------------------------------------
/api/todo/lib/response.js:
--------------------------------------------------------------------------------
1 | module.exports.create = (status, data) => {
2 | return {
3 | statusCode: status,
4 | headers: {
5 | "Access-Control-Allow-Origin": "*"
6 | },
7 | body: JSON.stringify(data)
8 | };
9 | };
10 |
--------------------------------------------------------------------------------
/api/todo/lib/todo.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var helper = require("./helper"),
4 | response = require("./response");
5 |
6 | module.exports.getAllTodos = (event, cb) => {
7 | helper
8 | .getAllTodos()
9 | .then(todos => {
10 | cb(
11 | null,
12 | response.create(200, {
13 | result: todos
14 | })
15 | );
16 | })
17 | .catch(err => {
18 | cb(
19 | null,
20 | response.create(500, {
21 | err: err
22 | })
23 | );
24 | });
25 | };
26 |
27 | module.exports.createTodo = (event, cb) => {
28 | helper
29 | .createTodo(JSON.parse(event.body))
30 | .then(result => {
31 | cb(null, response.create(201, {}));
32 | })
33 | .catch(err => {
34 | cb(
35 | null,
36 | response.create(500, {
37 | err: err
38 | })
39 | );
40 | });
41 | };
42 |
43 | module.exports.updateTodo = (event, cb) => {
44 | helper
45 | .updateTodo(JSON.parse(event.body))
46 | .then(result => {
47 | cb(null, response.create(200, {}));
48 | })
49 | .catch(err => {
50 | cb(
51 | null,
52 | response.create(500, {
53 | err: err
54 | })
55 | );
56 | });
57 | };
58 |
59 | module.exports.updateTodoStatus = (event, cb) => {
60 | helper
61 | .updateTodoStatus(JSON.parse(event.body))
62 | .then(result => {
63 | cb(null, response.create(200, {}));
64 | })
65 | .catch(err => {
66 | cb(
67 | null,
68 | response.create(500, {
69 | err: err
70 | })
71 | );
72 | });
73 | };
74 |
75 | module.exports.deleteTodo = (event, cb) => {
76 | helper
77 | .deleteTodo(event.pathParameters)
78 | .then(result => {
79 | cb(null, response.create(200, {}));
80 | })
81 | .catch(err => {
82 | cb(
83 | null,
84 | response.create(500, {
85 | err: err
86 | })
87 | );
88 | });
89 | };
90 |
--------------------------------------------------------------------------------
/api/todo/offline/migrations/todo-seed.json:
--------------------------------------------------------------------------------
1 | [{
2 | "id": "c796d733-9779-45c5-a130-20fd1fd0b652",
3 | "task": "Wake up",
4 | "isCompleted": true
5 | }, {
6 | "id": "43fca9c6-91f4-4593-9e5c-fac85beab5a7",
7 | "task": "Eat breakfast",
8 | "isCompleted": true
9 | }, {
10 | "id": "42828c93-afb5-4761-ba55-becfda40b11b",
11 | "task": "Go to office",
12 | "isCompleted": false
13 | }]
--------------------------------------------------------------------------------
/api/todo/offline/migrations/todo.yml:
--------------------------------------------------------------------------------
1 | todosTable:
2 | Type: AWS::DynamoDB::Table
3 | DeletionPolicy : Retain
4 | Properties:
5 | TableName: ${self:custom.DB_PREFIX}-todos
6 | AttributeDefinitions:
7 | - AttributeName: id
8 | AttributeType: S
9 | KeySchema:
10 | - AttributeName: id
11 | KeyType: HASH
12 | ProvisionedThroughput:
13 | ReadCapacityUnits: 1
14 | WriteCapacityUnits: 1
--------------------------------------------------------------------------------
/api/todo/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "api",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "@babel/code-frame": {
8 | "version": "7.0.0",
9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz",
10 | "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==",
11 | "dev": true,
12 | "requires": {
13 | "@babel/highlight": "^7.0.0"
14 | }
15 | },
16 | "@babel/core": {
17 | "version": "7.2.2",
18 | "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.2.2.tgz",
19 | "integrity": "sha512-59vB0RWt09cAct5EIe58+NzGP4TFSD3Bz//2/ELy3ZeTeKF6VTD1AXlH8BGGbCX0PuobZBsIzO7IAI9PH67eKw==",
20 | "dev": true,
21 | "requires": {
22 | "@babel/code-frame": "^7.0.0",
23 | "@babel/generator": "^7.2.2",
24 | "@babel/helpers": "^7.2.0",
25 | "@babel/parser": "^7.2.2",
26 | "@babel/template": "^7.2.2",
27 | "@babel/traverse": "^7.2.2",
28 | "@babel/types": "^7.2.2",
29 | "convert-source-map": "^1.1.0",
30 | "debug": "^4.1.0",
31 | "json5": "^2.1.0",
32 | "lodash": "^4.17.10",
33 | "resolve": "^1.3.2",
34 | "semver": "^5.4.1",
35 | "source-map": "^0.5.0"
36 | }
37 | },
38 | "@babel/generator": {
39 | "version": "7.2.2",
40 | "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.2.2.tgz",
41 | "integrity": "sha512-I4o675J/iS8k+P38dvJ3IBGqObLXyQLTxtrR4u9cSUJOURvafeEWb/pFMOTwtNrmq73mJzyF6ueTbO1BtN0Zeg==",
42 | "dev": true,
43 | "requires": {
44 | "@babel/types": "^7.2.2",
45 | "jsesc": "^2.5.1",
46 | "lodash": "^4.17.10",
47 | "source-map": "^0.5.0",
48 | "trim-right": "^1.0.1"
49 | }
50 | },
51 | "@babel/helper-function-name": {
52 | "version": "7.1.0",
53 | "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz",
54 | "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==",
55 | "dev": true,
56 | "requires": {
57 | "@babel/helper-get-function-arity": "^7.0.0",
58 | "@babel/template": "^7.1.0",
59 | "@babel/types": "^7.0.0"
60 | }
61 | },
62 | "@babel/helper-get-function-arity": {
63 | "version": "7.0.0",
64 | "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz",
65 | "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==",
66 | "dev": true,
67 | "requires": {
68 | "@babel/types": "^7.0.0"
69 | }
70 | },
71 | "@babel/helper-split-export-declaration": {
72 | "version": "7.0.0",
73 | "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz",
74 | "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==",
75 | "dev": true,
76 | "requires": {
77 | "@babel/types": "^7.0.0"
78 | }
79 | },
80 | "@babel/helpers": {
81 | "version": "7.2.0",
82 | "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.2.0.tgz",
83 | "integrity": "sha512-Fr07N+ea0dMcMN8nFpuK6dUIT7/ivt9yKQdEEnjVS83tG2pHwPi03gYmk/tyuwONnZ+sY+GFFPlWGgCtW1hF9A==",
84 | "dev": true,
85 | "requires": {
86 | "@babel/template": "^7.1.2",
87 | "@babel/traverse": "^7.1.5",
88 | "@babel/types": "^7.2.0"
89 | }
90 | },
91 | "@babel/highlight": {
92 | "version": "7.0.0",
93 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz",
94 | "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==",
95 | "dev": true,
96 | "requires": {
97 | "chalk": "^2.0.0",
98 | "esutils": "^2.0.2",
99 | "js-tokens": "^4.0.0"
100 | }
101 | },
102 | "@babel/parser": {
103 | "version": "7.2.3",
104 | "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.2.3.tgz",
105 | "integrity": "sha512-0LyEcVlfCoFmci8mXx8A5oIkpkOgyo8dRHtxBnK9RRBwxO2+JZPNsqtVEZQ7mJFPxnXF9lfmU24mHOPI0qnlkA==",
106 | "dev": true
107 | },
108 | "@babel/register": {
109 | "version": "7.0.0",
110 | "resolved": "https://registry.npmjs.org/@babel/register/-/register-7.0.0.tgz",
111 | "integrity": "sha512-f/+CRmaCe7rVEvcvPvxeA8j5aJhHC3aJie7YuqcMDhUOuyWLA7J/aNrTaHIzoWPEhpHA54mec4Mm8fv8KBlv3g==",
112 | "dev": true,
113 | "requires": {
114 | "core-js": "^2.5.7",
115 | "find-cache-dir": "^1.0.0",
116 | "home-or-tmp": "^3.0.0",
117 | "lodash": "^4.17.10",
118 | "mkdirp": "^0.5.1",
119 | "pirates": "^4.0.0",
120 | "source-map-support": "^0.5.9"
121 | }
122 | },
123 | "@babel/template": {
124 | "version": "7.2.2",
125 | "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz",
126 | "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==",
127 | "dev": true,
128 | "requires": {
129 | "@babel/code-frame": "^7.0.0",
130 | "@babel/parser": "^7.2.2",
131 | "@babel/types": "^7.2.2"
132 | }
133 | },
134 | "@babel/traverse": {
135 | "version": "7.2.3",
136 | "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.2.3.tgz",
137 | "integrity": "sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw==",
138 | "dev": true,
139 | "requires": {
140 | "@babel/code-frame": "^7.0.0",
141 | "@babel/generator": "^7.2.2",
142 | "@babel/helper-function-name": "^7.1.0",
143 | "@babel/helper-split-export-declaration": "^7.0.0",
144 | "@babel/parser": "^7.2.3",
145 | "@babel/types": "^7.2.2",
146 | "debug": "^4.1.0",
147 | "globals": "^11.1.0",
148 | "lodash": "^4.17.10"
149 | }
150 | },
151 | "@babel/types": {
152 | "version": "7.2.2",
153 | "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.2.2.tgz",
154 | "integrity": "sha512-fKCuD6UFUMkR541eDWL+2ih/xFZBXPOg/7EQFeTluMDebfqR4jrpaCjLhkWlQS4hT6nRa2PMEgXKbRB5/H2fpg==",
155 | "dev": true,
156 | "requires": {
157 | "esutils": "^2.0.2",
158 | "lodash": "^4.17.10",
159 | "to-fast-properties": "^2.0.0"
160 | }
161 | },
162 | "accept": {
163 | "version": "2.1.4",
164 | "resolved": "https://registry.npmjs.org/accept/-/accept-2.1.4.tgz",
165 | "integrity": "sha1-iHr1TO7lx/RDBGGXHsQAxh0JrLs=",
166 | "dev": true,
167 | "requires": {
168 | "boom": "5.x.x",
169 | "hoek": "4.x.x"
170 | },
171 | "dependencies": {
172 | "boom": {
173 | "version": "5.2.0",
174 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
175 | "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
176 | "dev": true,
177 | "requires": {
178 | "hoek": "4.x.x"
179 | }
180 | }
181 | }
182 | },
183 | "ammo": {
184 | "version": "2.0.4",
185 | "resolved": "https://registry.npmjs.org/ammo/-/ammo-2.0.4.tgz",
186 | "integrity": "sha1-v4CqshFpjqePY+9efxE91dnokX8=",
187 | "dev": true,
188 | "requires": {
189 | "boom": "5.x.x",
190 | "hoek": "4.x.x"
191 | },
192 | "dependencies": {
193 | "boom": {
194 | "version": "5.2.0",
195 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
196 | "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
197 | "dev": true,
198 | "requires": {
199 | "hoek": "4.x.x"
200 | }
201 | }
202 | }
203 | },
204 | "ansi-styles": {
205 | "version": "3.2.1",
206 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
207 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
208 | "dev": true,
209 | "requires": {
210 | "color-convert": "^1.9.0"
211 | }
212 | },
213 | "aws-sdk": {
214 | "version": "2.384.0",
215 | "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.384.0.tgz",
216 | "integrity": "sha512-E+pIOWFNhQH7GCkOl5GU+Vl42MlaKtAq0Yenaa2fRGult9097u7TnUx45V1pNKMCN9RnEFWQy3ZH1TEPEYJ0fw==",
217 | "requires": {
218 | "buffer": "4.9.1",
219 | "events": "1.1.1",
220 | "ieee754": "1.1.8",
221 | "jmespath": "0.15.0",
222 | "querystring": "0.2.0",
223 | "sax": "1.2.1",
224 | "url": "0.10.3",
225 | "uuid": "3.1.0",
226 | "xml2js": "0.4.19"
227 | }
228 | },
229 | "b64": {
230 | "version": "3.0.3",
231 | "resolved": "https://registry.npmjs.org/b64/-/b64-3.0.3.tgz",
232 | "integrity": "sha512-Pbeh0i6OLubPJdIdCepn8ZQHwN2MWznZHbHABSTEfQ706ie+yuxNSaPdqX1xRatT6WanaS1EazMiSg0NUW2XxQ==",
233 | "dev": true
234 | },
235 | "balanced-match": {
236 | "version": "1.0.0",
237 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
238 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
239 | },
240 | "base64-js": {
241 | "version": "1.3.0",
242 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz",
243 | "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw=="
244 | },
245 | "block-stream": {
246 | "version": "0.0.9",
247 | "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz",
248 | "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=",
249 | "requires": {
250 | "inherits": "~2.0.0"
251 | }
252 | },
253 | "bluebird": {
254 | "version": "3.5.3",
255 | "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz",
256 | "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw=="
257 | },
258 | "boom": {
259 | "version": "4.3.1",
260 | "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz",
261 | "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=",
262 | "dev": true,
263 | "requires": {
264 | "hoek": "4.x.x"
265 | }
266 | },
267 | "brace-expansion": {
268 | "version": "1.1.11",
269 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
270 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
271 | "requires": {
272 | "balanced-match": "^1.0.0",
273 | "concat-map": "0.0.1"
274 | }
275 | },
276 | "buffer": {
277 | "version": "4.9.1",
278 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
279 | "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=",
280 | "requires": {
281 | "base64-js": "^1.0.2",
282 | "ieee754": "^1.1.4",
283 | "isarray": "^1.0.0"
284 | }
285 | },
286 | "buffer-equal-constant-time": {
287 | "version": "1.0.1",
288 | "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
289 | "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=",
290 | "dev": true
291 | },
292 | "buffer-from": {
293 | "version": "1.1.1",
294 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
295 | "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
296 | "dev": true
297 | },
298 | "call": {
299 | "version": "3.0.4",
300 | "resolved": "https://registry.npmjs.org/call/-/call-3.0.4.tgz",
301 | "integrity": "sha1-44Dy8qSRMwqnkIU1X4vggId9VZ4=",
302 | "dev": true,
303 | "requires": {
304 | "boom": "4.x.x",
305 | "hoek": "4.x.x"
306 | }
307 | },
308 | "catbox": {
309 | "version": "7.1.5",
310 | "resolved": "https://registry.npmjs.org/catbox/-/catbox-7.1.5.tgz",
311 | "integrity": "sha512-4fui5lELzqZ+9cnaAP/BcqXTH6LvWLBRtFhJ0I4FfgfXiSaZcf6k9m9dqOyChiTxNYtvLk7ZMYSf7ahMq3bf5A==",
312 | "dev": true,
313 | "requires": {
314 | "boom": "5.x.x",
315 | "hoek": "4.x.x",
316 | "joi": "10.x.x"
317 | },
318 | "dependencies": {
319 | "boom": {
320 | "version": "5.2.0",
321 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
322 | "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
323 | "dev": true,
324 | "requires": {
325 | "hoek": "4.x.x"
326 | }
327 | },
328 | "joi": {
329 | "version": "10.6.0",
330 | "resolved": "https://registry.npmjs.org/joi/-/joi-10.6.0.tgz",
331 | "integrity": "sha512-hBF3LcqyAid+9X/pwg+eXjD2QBZI5eXnBFJYaAkH4SK3mp9QSRiiQnDYlmlz5pccMvnLcJRS4whhDOTCkmsAdQ==",
332 | "dev": true,
333 | "requires": {
334 | "hoek": "4.x.x",
335 | "isemail": "2.x.x",
336 | "items": "2.x.x",
337 | "topo": "2.x.x"
338 | }
339 | }
340 | }
341 | },
342 | "catbox-memory": {
343 | "version": "2.0.4",
344 | "resolved": "https://registry.npmjs.org/catbox-memory/-/catbox-memory-2.0.4.tgz",
345 | "integrity": "sha1-Qz4lWQLK9UIz0ShkKcj03xToItU=",
346 | "dev": true,
347 | "requires": {
348 | "hoek": "4.x.x"
349 | }
350 | },
351 | "chalk": {
352 | "version": "2.4.2",
353 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
354 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
355 | "dev": true,
356 | "requires": {
357 | "ansi-styles": "^3.2.1",
358 | "escape-string-regexp": "^1.0.5",
359 | "supports-color": "^5.3.0"
360 | }
361 | },
362 | "color-convert": {
363 | "version": "1.9.3",
364 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
365 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
366 | "dev": true,
367 | "requires": {
368 | "color-name": "1.1.3"
369 | }
370 | },
371 | "color-name": {
372 | "version": "1.1.3",
373 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
374 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
375 | "dev": true
376 | },
377 | "commondir": {
378 | "version": "1.0.1",
379 | "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz",
380 | "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=",
381 | "dev": true
382 | },
383 | "concat-map": {
384 | "version": "0.0.1",
385 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
386 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
387 | },
388 | "content": {
389 | "version": "3.0.7",
390 | "resolved": "https://registry.npmjs.org/content/-/content-3.0.7.tgz",
391 | "integrity": "sha512-LXtnSnvE+Z1Cjpa3P9gh9kb396qV4MqpfwKy777BOSF8n6nw2vAi03tHNl0/XRqZUyzVzY/+nMXOZVnEapWzdg==",
392 | "dev": true,
393 | "requires": {
394 | "boom": "5.x.x"
395 | },
396 | "dependencies": {
397 | "boom": {
398 | "version": "5.2.0",
399 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
400 | "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
401 | "dev": true,
402 | "requires": {
403 | "hoek": "4.x.x"
404 | }
405 | }
406 | }
407 | },
408 | "convert-source-map": {
409 | "version": "1.6.0",
410 | "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz",
411 | "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==",
412 | "dev": true,
413 | "requires": {
414 | "safe-buffer": "~5.1.1"
415 | }
416 | },
417 | "core-js": {
418 | "version": "2.6.1",
419 | "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.1.tgz",
420 | "integrity": "sha512-L72mmmEayPJBejKIWe2pYtGis5r0tQ5NaJekdhyXgeMQTpJoBsH0NL4ElY2LfSoV15xeQWKQ+XTTOZdyero5Xg==",
421 | "dev": true
422 | },
423 | "cryptiles": {
424 | "version": "4.1.3",
425 | "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-4.1.3.tgz",
426 | "integrity": "sha512-gT9nyTMSUC1JnziQpPbxKGBbUg8VL7Zn2NB4E1cJYvuXdElHrwxrV9bmltZGDzet45zSDGyYceueke1TjynGzw==",
427 | "dev": true,
428 | "requires": {
429 | "boom": "7.x.x"
430 | },
431 | "dependencies": {
432 | "boom": {
433 | "version": "7.3.0",
434 | "resolved": "https://registry.npmjs.org/boom/-/boom-7.3.0.tgz",
435 | "integrity": "sha512-Swpoyi2t5+GhOEGw8rEsKvTxFLIDiiKoUc2gsoV6Lyr43LHBIzch3k2MvYUs8RTROrIkVJ3Al0TkaOGjnb+B6A==",
436 | "dev": true,
437 | "requires": {
438 | "hoek": "6.x.x"
439 | }
440 | },
441 | "hoek": {
442 | "version": "6.1.2",
443 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.2.tgz",
444 | "integrity": "sha512-6qhh/wahGYZHFSFw12tBbJw5fsAhhwrrG/y3Cs0YMTv2WzMnL0oLPnQJjv1QJvEfylRSOFuP+xCu+tdx0tD16Q==",
445 | "dev": true
446 | }
447 | }
448 | },
449 | "debug": {
450 | "version": "4.1.1",
451 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
452 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
453 | "dev": true,
454 | "requires": {
455 | "ms": "^2.1.1"
456 | }
457 | },
458 | "dynamodb-localhost": {
459 | "version": "0.0.5",
460 | "resolved": "https://registry.npmjs.org/dynamodb-localhost/-/dynamodb-localhost-0.0.5.tgz",
461 | "integrity": "sha1-LfzVwKyD5TQyf11dpdrajTExB1U=",
462 | "requires": {
463 | "mkdirp": "^0.5.0",
464 | "progress": "^1.1.8",
465 | "rmdir": "^1.2.0",
466 | "tar": "^2.0.0"
467 | }
468 | },
469 | "ecdsa-sig-formatter": {
470 | "version": "1.0.10",
471 | "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz",
472 | "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=",
473 | "dev": true,
474 | "requires": {
475 | "safe-buffer": "^5.0.1"
476 | }
477 | },
478 | "escape-string-regexp": {
479 | "version": "1.0.5",
480 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
481 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
482 | "dev": true
483 | },
484 | "esutils": {
485 | "version": "2.0.2",
486 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
487 | "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
488 | "dev": true
489 | },
490 | "events": {
491 | "version": "1.1.1",
492 | "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",
493 | "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ="
494 | },
495 | "find-cache-dir": {
496 | "version": "1.0.0",
497 | "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz",
498 | "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=",
499 | "dev": true,
500 | "requires": {
501 | "commondir": "^1.0.1",
502 | "make-dir": "^1.0.0",
503 | "pkg-dir": "^2.0.0"
504 | }
505 | },
506 | "find-up": {
507 | "version": "2.1.0",
508 | "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
509 | "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
510 | "dev": true,
511 | "requires": {
512 | "locate-path": "^2.0.0"
513 | }
514 | },
515 | "fs.realpath": {
516 | "version": "1.0.0",
517 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
518 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
519 | },
520 | "fstream": {
521 | "version": "1.0.11",
522 | "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
523 | "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=",
524 | "requires": {
525 | "graceful-fs": "^4.1.2",
526 | "inherits": "~2.0.0",
527 | "mkdirp": ">=0.5 0",
528 | "rimraf": "2"
529 | }
530 | },
531 | "glob": {
532 | "version": "7.1.3",
533 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
534 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
535 | "requires": {
536 | "fs.realpath": "^1.0.0",
537 | "inflight": "^1.0.4",
538 | "inherits": "2",
539 | "minimatch": "^3.0.4",
540 | "once": "^1.3.0",
541 | "path-is-absolute": "^1.0.0"
542 | }
543 | },
544 | "globals": {
545 | "version": "11.9.0",
546 | "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz",
547 | "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==",
548 | "dev": true
549 | },
550 | "graceful-fs": {
551 | "version": "4.1.15",
552 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz",
553 | "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA=="
554 | },
555 | "h2o2": {
556 | "version": "5.4.0",
557 | "resolved": "https://registry.npmjs.org/h2o2/-/h2o2-5.4.0.tgz",
558 | "integrity": "sha1-1oV8oFNVIAyJCzSmZgbKugIp7Vg=",
559 | "dev": true,
560 | "requires": {
561 | "boom": "3.X.X",
562 | "hoek": "4.X.X",
563 | "joi": "9.X.X",
564 | "wreck": "9.X.X"
565 | },
566 | "dependencies": {
567 | "boom": {
568 | "version": "3.2.2",
569 | "resolved": "https://registry.npmjs.org/boom/-/boom-3.2.2.tgz",
570 | "integrity": "sha1-DwzF0ErcUAO4x9cfQsynJx/vDng=",
571 | "dev": true,
572 | "requires": {
573 | "hoek": "4.x.x"
574 | }
575 | }
576 | }
577 | },
578 | "hapi": {
579 | "version": "14.2.0",
580 | "resolved": "https://registry.npmjs.org/hapi/-/hapi-14.2.0.tgz",
581 | "integrity": "sha1-5P4vwYJZig+B6HtBtr4PvTHHVAk=",
582 | "dev": true,
583 | "requires": {
584 | "accept": "2.x.x",
585 | "ammo": "2.x.x",
586 | "boom": "3.x.x",
587 | "call": "3.x.x",
588 | "catbox": "7.x.x",
589 | "catbox-memory": "2.x.x",
590 | "cryptiles": "3.x.x",
591 | "heavy": "4.x.x",
592 | "hoek": "4.x.x",
593 | "iron": "4.x.x",
594 | "items": "2.x.x",
595 | "joi": "9.x.x",
596 | "kilt": "2.x.x",
597 | "mimos": "3.x.x",
598 | "peekaboo": "2.x.x",
599 | "shot": "3.x.x",
600 | "statehood": "4.x.x",
601 | "subtext": "4.x.x",
602 | "topo": "2.x.x"
603 | },
604 | "dependencies": {
605 | "boom": {
606 | "version": "3.2.2",
607 | "resolved": "https://registry.npmjs.org/boom/-/boom-3.2.2.tgz",
608 | "integrity": "sha1-DwzF0ErcUAO4x9cfQsynJx/vDng=",
609 | "dev": true,
610 | "requires": {
611 | "hoek": "4.x.x"
612 | }
613 | },
614 | "cryptiles": {
615 | "version": "3.1.4",
616 | "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.4.tgz",
617 | "integrity": "sha512-8I1sgZHfVwcSOY6mSGpVU3lw/GSIZvusg8dD2+OGehCJpOhQRLNcH0qb9upQnOH4XhgxxFJSg6E2kx95deb1Tw==",
618 | "dev": true,
619 | "requires": {
620 | "boom": "5.x.x"
621 | },
622 | "dependencies": {
623 | "boom": {
624 | "version": "5.2.0",
625 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
626 | "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
627 | "dev": true,
628 | "requires": {
629 | "hoek": "4.x.x"
630 | }
631 | }
632 | }
633 | }
634 | }
635 | },
636 | "hapi-cors-headers": {
637 | "version": "1.0.3",
638 | "resolved": "https://registry.npmjs.org/hapi-cors-headers/-/hapi-cors-headers-1.0.3.tgz",
639 | "integrity": "sha512-U/y+kpVLUJ0y86fEk8yleou9C1T5wFopcWQjuxKdMXzCcymTjfSqGz59waqvngUs1SbeXav/y8Ga9C0G0L1MGg==",
640 | "dev": true
641 | },
642 | "has-flag": {
643 | "version": "3.0.0",
644 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
645 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
646 | "dev": true
647 | },
648 | "heavy": {
649 | "version": "4.0.4",
650 | "resolved": "https://registry.npmjs.org/heavy/-/heavy-4.0.4.tgz",
651 | "integrity": "sha1-NskTNsAMz+hSyqTRUwhjNc0vAOk=",
652 | "dev": true,
653 | "requires": {
654 | "boom": "5.x.x",
655 | "hoek": "4.x.x",
656 | "joi": "10.x.x"
657 | },
658 | "dependencies": {
659 | "boom": {
660 | "version": "5.2.0",
661 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
662 | "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
663 | "dev": true,
664 | "requires": {
665 | "hoek": "4.x.x"
666 | }
667 | },
668 | "joi": {
669 | "version": "10.6.0",
670 | "resolved": "https://registry.npmjs.org/joi/-/joi-10.6.0.tgz",
671 | "integrity": "sha512-hBF3LcqyAid+9X/pwg+eXjD2QBZI5eXnBFJYaAkH4SK3mp9QSRiiQnDYlmlz5pccMvnLcJRS4whhDOTCkmsAdQ==",
672 | "dev": true,
673 | "requires": {
674 | "hoek": "4.x.x",
675 | "isemail": "2.x.x",
676 | "items": "2.x.x",
677 | "topo": "2.x.x"
678 | }
679 | }
680 | }
681 | },
682 | "hoek": {
683 | "version": "4.2.1",
684 | "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz",
685 | "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==",
686 | "dev": true
687 | },
688 | "home-or-tmp": {
689 | "version": "3.0.0",
690 | "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-3.0.0.tgz",
691 | "integrity": "sha1-V6j+JM8zzdUkhgoVgh3cJchmcfs=",
692 | "dev": true
693 | },
694 | "ieee754": {
695 | "version": "1.1.8",
696 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz",
697 | "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q="
698 | },
699 | "inflight": {
700 | "version": "1.0.6",
701 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
702 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
703 | "requires": {
704 | "once": "^1.3.0",
705 | "wrappy": "1"
706 | }
707 | },
708 | "inherits": {
709 | "version": "2.0.3",
710 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
711 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
712 | },
713 | "iron": {
714 | "version": "4.0.5",
715 | "resolved": "https://registry.npmjs.org/iron/-/iron-4.0.5.tgz",
716 | "integrity": "sha1-TwQszri5c480a1mqc0yDqJvDFCg=",
717 | "dev": true,
718 | "requires": {
719 | "boom": "5.x.x",
720 | "cryptiles": "3.x.x",
721 | "hoek": "4.x.x"
722 | },
723 | "dependencies": {
724 | "boom": {
725 | "version": "5.2.0",
726 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
727 | "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
728 | "dev": true,
729 | "requires": {
730 | "hoek": "4.x.x"
731 | }
732 | },
733 | "cryptiles": {
734 | "version": "3.1.4",
735 | "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.4.tgz",
736 | "integrity": "sha512-8I1sgZHfVwcSOY6mSGpVU3lw/GSIZvusg8dD2+OGehCJpOhQRLNcH0qb9upQnOH4XhgxxFJSg6E2kx95deb1Tw==",
737 | "dev": true,
738 | "requires": {
739 | "boom": "5.x.x"
740 | }
741 | }
742 | }
743 | },
744 | "is": {
745 | "version": "0.2.7",
746 | "resolved": "https://registry.npmjs.org/is/-/is-0.2.7.tgz",
747 | "integrity": "sha1-OzSixI81mXLzUEKEkZOucmS2NWI="
748 | },
749 | "isarray": {
750 | "version": "1.0.0",
751 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
752 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
753 | },
754 | "isemail": {
755 | "version": "2.2.1",
756 | "resolved": "https://registry.npmjs.org/isemail/-/isemail-2.2.1.tgz",
757 | "integrity": "sha1-A1PT2aYpUQgMJiwqoKQrjqjp4qY=",
758 | "dev": true
759 | },
760 | "items": {
761 | "version": "2.1.2",
762 | "resolved": "https://registry.npmjs.org/items/-/items-2.1.2.tgz",
763 | "integrity": "sha512-kezcEqgB97BGeZZYtX/MA8AG410ptURstvnz5RAgyFZ8wQFPMxHY8GpTq+/ZHKT3frSlIthUq7EvLt9xn3TvXg==",
764 | "dev": true
765 | },
766 | "jmespath": {
767 | "version": "0.15.0",
768 | "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz",
769 | "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc="
770 | },
771 | "joi": {
772 | "version": "9.2.0",
773 | "resolved": "https://registry.npmjs.org/joi/-/joi-9.2.0.tgz",
774 | "integrity": "sha1-M4WseQGSEwy+Iw6ALsAskhW7/to=",
775 | "dev": true,
776 | "requires": {
777 | "hoek": "4.x.x",
778 | "isemail": "2.x.x",
779 | "items": "2.x.x",
780 | "moment": "2.x.x",
781 | "topo": "2.x.x"
782 | }
783 | },
784 | "js-string-escape": {
785 | "version": "1.0.1",
786 | "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz",
787 | "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=",
788 | "dev": true
789 | },
790 | "js-tokens": {
791 | "version": "4.0.0",
792 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
793 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
794 | "dev": true
795 | },
796 | "jsesc": {
797 | "version": "2.5.2",
798 | "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
799 | "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
800 | "dev": true
801 | },
802 | "json5": {
803 | "version": "2.1.0",
804 | "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz",
805 | "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==",
806 | "dev": true,
807 | "requires": {
808 | "minimist": "^1.2.0"
809 | },
810 | "dependencies": {
811 | "minimist": {
812 | "version": "1.2.0",
813 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
814 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
815 | "dev": true
816 | }
817 | }
818 | },
819 | "jsonpath-plus": {
820 | "version": "0.16.0",
821 | "resolved": "https://registry.npmjs.org/jsonpath-plus/-/jsonpath-plus-0.16.0.tgz",
822 | "integrity": "sha1-/kQbI/A+xpeaVgNROYjNPtt9tdw=",
823 | "dev": true
824 | },
825 | "jsonwebtoken": {
826 | "version": "8.4.0",
827 | "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.4.0.tgz",
828 | "integrity": "sha512-coyXjRTCy0pw5WYBpMvWOMN+Kjaik2MwTUIq9cna/W7NpO9E+iYbumZONAz3hcr+tXFJECoQVrtmIoC3Oz0gvg==",
829 | "dev": true,
830 | "requires": {
831 | "jws": "^3.1.5",
832 | "lodash.includes": "^4.3.0",
833 | "lodash.isboolean": "^3.0.3",
834 | "lodash.isinteger": "^4.0.4",
835 | "lodash.isnumber": "^3.0.3",
836 | "lodash.isplainobject": "^4.0.6",
837 | "lodash.isstring": "^4.0.1",
838 | "lodash.once": "^4.0.0",
839 | "ms": "^2.1.1"
840 | }
841 | },
842 | "jwa": {
843 | "version": "1.1.6",
844 | "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz",
845 | "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==",
846 | "dev": true,
847 | "requires": {
848 | "buffer-equal-constant-time": "1.0.1",
849 | "ecdsa-sig-formatter": "1.0.10",
850 | "safe-buffer": "^5.0.1"
851 | }
852 | },
853 | "jws": {
854 | "version": "3.1.5",
855 | "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz",
856 | "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==",
857 | "dev": true,
858 | "requires": {
859 | "jwa": "^1.1.5",
860 | "safe-buffer": "^5.0.1"
861 | }
862 | },
863 | "kilt": {
864 | "version": "2.0.2",
865 | "resolved": "https://registry.npmjs.org/kilt/-/kilt-2.0.2.tgz",
866 | "integrity": "sha1-BNcYPCmKEjLv3ffdyllZqPYwHiA=",
867 | "dev": true,
868 | "requires": {
869 | "hoek": "4.x.x"
870 | }
871 | },
872 | "locate-path": {
873 | "version": "2.0.0",
874 | "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
875 | "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
876 | "dev": true,
877 | "requires": {
878 | "p-locate": "^2.0.0",
879 | "path-exists": "^3.0.0"
880 | }
881 | },
882 | "lodash": {
883 | "version": "4.17.11",
884 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
885 | "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg=="
886 | },
887 | "lodash.includes": {
888 | "version": "4.3.0",
889 | "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
890 | "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=",
891 | "dev": true
892 | },
893 | "lodash.isboolean": {
894 | "version": "3.0.3",
895 | "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
896 | "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=",
897 | "dev": true
898 | },
899 | "lodash.isinteger": {
900 | "version": "4.0.4",
901 | "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
902 | "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=",
903 | "dev": true
904 | },
905 | "lodash.isnumber": {
906 | "version": "3.0.3",
907 | "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",
908 | "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=",
909 | "dev": true
910 | },
911 | "lodash.isplainobject": {
912 | "version": "4.0.6",
913 | "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
914 | "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=",
915 | "dev": true
916 | },
917 | "lodash.isstring": {
918 | "version": "4.0.1",
919 | "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
920 | "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=",
921 | "dev": true
922 | },
923 | "lodash.once": {
924 | "version": "4.1.1",
925 | "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
926 | "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=",
927 | "dev": true
928 | },
929 | "make-dir": {
930 | "version": "1.3.0",
931 | "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
932 | "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
933 | "dev": true,
934 | "requires": {
935 | "pify": "^3.0.0"
936 | }
937 | },
938 | "mime-db": {
939 | "version": "1.37.0",
940 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz",
941 | "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==",
942 | "dev": true
943 | },
944 | "mimos": {
945 | "version": "3.0.3",
946 | "resolved": "https://registry.npmjs.org/mimos/-/mimos-3.0.3.tgz",
947 | "integrity": "sha1-uRCQcq03jCty9qAQHEPd+ys2ZB8=",
948 | "dev": true,
949 | "requires": {
950 | "hoek": "4.x.x",
951 | "mime-db": "1.x.x"
952 | }
953 | },
954 | "minimatch": {
955 | "version": "3.0.4",
956 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
957 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
958 | "requires": {
959 | "brace-expansion": "^1.1.7"
960 | }
961 | },
962 | "minimist": {
963 | "version": "0.0.8",
964 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
965 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
966 | },
967 | "mkdirp": {
968 | "version": "0.5.1",
969 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
970 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
971 | "requires": {
972 | "minimist": "0.0.8"
973 | }
974 | },
975 | "moment": {
976 | "version": "2.23.0",
977 | "resolved": "https://registry.npmjs.org/moment/-/moment-2.23.0.tgz",
978 | "integrity": "sha512-3IE39bHVqFbWWaPOMHZF98Q9c3LDKGTmypMiTM2QygGXXElkFWIH7GxfmlwmY2vwa+wmNsoYZmG2iusf1ZjJoA==",
979 | "dev": true
980 | },
981 | "ms": {
982 | "version": "2.1.1",
983 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
984 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
985 | "dev": true
986 | },
987 | "nigel": {
988 | "version": "2.0.2",
989 | "resolved": "https://registry.npmjs.org/nigel/-/nigel-2.0.2.tgz",
990 | "integrity": "sha1-k6GGb7DFLYc5CqdeKxYfS1x15bE=",
991 | "dev": true,
992 | "requires": {
993 | "hoek": "4.x.x",
994 | "vise": "2.x.x"
995 | }
996 | },
997 | "node-modules-regexp": {
998 | "version": "1.0.0",
999 | "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz",
1000 | "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=",
1001 | "dev": true
1002 | },
1003 | "node.extend": {
1004 | "version": "1.0.8",
1005 | "resolved": "https://registry.npmjs.org/node.extend/-/node.extend-1.0.8.tgz",
1006 | "integrity": "sha1-urBDefc4P0WHmQyd8Htqf2Xbdys=",
1007 | "requires": {
1008 | "is": "~0.2.6",
1009 | "object-keys": "~0.4.0"
1010 | }
1011 | },
1012 | "node.flow": {
1013 | "version": "1.2.3",
1014 | "resolved": "https://registry.npmjs.org/node.flow/-/node.flow-1.2.3.tgz",
1015 | "integrity": "sha1-4cRKgq7KjXi0WKd/s9xkLy66Jkk=",
1016 | "requires": {
1017 | "node.extend": "1.0.8"
1018 | }
1019 | },
1020 | "object-keys": {
1021 | "version": "0.4.0",
1022 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz",
1023 | "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY="
1024 | },
1025 | "once": {
1026 | "version": "1.4.0",
1027 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
1028 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
1029 | "requires": {
1030 | "wrappy": "1"
1031 | }
1032 | },
1033 | "p-limit": {
1034 | "version": "1.3.0",
1035 | "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
1036 | "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
1037 | "dev": true,
1038 | "requires": {
1039 | "p-try": "^1.0.0"
1040 | }
1041 | },
1042 | "p-locate": {
1043 | "version": "2.0.0",
1044 | "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
1045 | "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
1046 | "dev": true,
1047 | "requires": {
1048 | "p-limit": "^1.1.0"
1049 | }
1050 | },
1051 | "p-try": {
1052 | "version": "1.0.0",
1053 | "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
1054 | "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
1055 | "dev": true
1056 | },
1057 | "path-exists": {
1058 | "version": "3.0.0",
1059 | "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
1060 | "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
1061 | "dev": true
1062 | },
1063 | "path-is-absolute": {
1064 | "version": "1.0.1",
1065 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
1066 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
1067 | },
1068 | "path-parse": {
1069 | "version": "1.0.6",
1070 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
1071 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
1072 | "dev": true
1073 | },
1074 | "peekaboo": {
1075 | "version": "2.0.2",
1076 | "resolved": "https://registry.npmjs.org/peekaboo/-/peekaboo-2.0.2.tgz",
1077 | "integrity": "sha1-/ELhOe/WmMb/KHCmsgwEfNmqKf8=",
1078 | "dev": true
1079 | },
1080 | "pez": {
1081 | "version": "2.1.5",
1082 | "resolved": "https://registry.npmjs.org/pez/-/pez-2.1.5.tgz",
1083 | "integrity": "sha1-XsLMYlAMw+tCNtSkFM9aF7XrUAc=",
1084 | "dev": true,
1085 | "requires": {
1086 | "b64": "3.x.x",
1087 | "boom": "5.x.x",
1088 | "content": "3.x.x",
1089 | "hoek": "4.x.x",
1090 | "nigel": "2.x.x"
1091 | },
1092 | "dependencies": {
1093 | "boom": {
1094 | "version": "5.2.0",
1095 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
1096 | "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
1097 | "dev": true,
1098 | "requires": {
1099 | "hoek": "4.x.x"
1100 | }
1101 | }
1102 | }
1103 | },
1104 | "pify": {
1105 | "version": "3.0.0",
1106 | "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
1107 | "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
1108 | "dev": true
1109 | },
1110 | "pirates": {
1111 | "version": "4.0.0",
1112 | "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.0.tgz",
1113 | "integrity": "sha512-8t5BsXy1LUIjn3WWOlOuFDuKswhQb/tkak641lvBgmPOBUQHXveORtlMCp6OdPV1dtuTaEahKA8VNz6uLfKBtA==",
1114 | "dev": true,
1115 | "requires": {
1116 | "node-modules-regexp": "^1.0.0"
1117 | }
1118 | },
1119 | "pkg-dir": {
1120 | "version": "2.0.0",
1121 | "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
1122 | "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
1123 | "dev": true,
1124 | "requires": {
1125 | "find-up": "^2.1.0"
1126 | }
1127 | },
1128 | "progress": {
1129 | "version": "1.1.8",
1130 | "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz",
1131 | "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74="
1132 | },
1133 | "punycode": {
1134 | "version": "1.3.2",
1135 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
1136 | "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0="
1137 | },
1138 | "querystring": {
1139 | "version": "0.2.0",
1140 | "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",
1141 | "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA="
1142 | },
1143 | "resolve": {
1144 | "version": "1.9.0",
1145 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.9.0.tgz",
1146 | "integrity": "sha512-TZNye00tI67lwYvzxCxHGjwTNlUV70io54/Ed4j6PscB8xVfuBJpRenI/o6dVk0cY0PYTY27AgCoGGxRnYuItQ==",
1147 | "dev": true,
1148 | "requires": {
1149 | "path-parse": "^1.0.6"
1150 | }
1151 | },
1152 | "rimraf": {
1153 | "version": "2.6.3",
1154 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
1155 | "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
1156 | "requires": {
1157 | "glob": "^7.1.3"
1158 | }
1159 | },
1160 | "rmdir": {
1161 | "version": "1.2.0",
1162 | "resolved": "https://registry.npmjs.org/rmdir/-/rmdir-1.2.0.tgz",
1163 | "integrity": "sha1-T+A1fLBhaMJY5z6WgJPcTooPMlM=",
1164 | "requires": {
1165 | "node.flow": "1.2.3"
1166 | }
1167 | },
1168 | "safe-buffer": {
1169 | "version": "5.1.2",
1170 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
1171 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
1172 | "dev": true
1173 | },
1174 | "sax": {
1175 | "version": "1.2.1",
1176 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz",
1177 | "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o="
1178 | },
1179 | "semver": {
1180 | "version": "5.6.0",
1181 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
1182 | "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==",
1183 | "dev": true
1184 | },
1185 | "serverless-dynamodb-local": {
1186 | "version": "0.2.30",
1187 | "resolved": "https://registry.npmjs.org/serverless-dynamodb-local/-/serverless-dynamodb-local-0.2.30.tgz",
1188 | "integrity": "sha512-dEeyfrDmXWM6KEqofVPuqVraZTenhlOjAsDjVrr2Kecq/mJs4FxeoDq9X/UriuZLENNzAAVX4BRt1HTX/JdRGg==",
1189 | "requires": {
1190 | "aws-sdk": "^2.7.0",
1191 | "bluebird": "^3.4.6",
1192 | "dynamodb-localhost": "^0.0.5",
1193 | "lodash": "^4.17.0"
1194 | }
1195 | },
1196 | "serverless-offline": {
1197 | "version": "3.31.3",
1198 | "resolved": "https://registry.npmjs.org/serverless-offline/-/serverless-offline-3.31.3.tgz",
1199 | "integrity": "sha512-Nl42T+RMSYaI+AuSN/3bn2hIXFzU6l50Oiri6173xVoEEKeRdRwdMzBa83/YQA2DQgiIc4zGXHThhcpUVz0OPw==",
1200 | "dev": true,
1201 | "requires": {
1202 | "@babel/core": "^7.0.0",
1203 | "@babel/register": "^7.0.0",
1204 | "boom": "^4.2.0",
1205 | "cryptiles": "^4.1.2",
1206 | "h2o2": "^5.4.0",
1207 | "hapi": "14.2.0",
1208 | "hapi-cors-headers": "^1.0.3",
1209 | "js-string-escape": "^1.0.1",
1210 | "jsonpath-plus": "^0.16.0",
1211 | "jsonwebtoken": "^8.3.0",
1212 | "lodash": "^4.17.10",
1213 | "uuid": "^3.3.2",
1214 | "velocityjs": "^1.1.2"
1215 | },
1216 | "dependencies": {
1217 | "uuid": {
1218 | "version": "3.3.2",
1219 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
1220 | "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==",
1221 | "dev": true
1222 | }
1223 | }
1224 | },
1225 | "shot": {
1226 | "version": "3.4.2",
1227 | "resolved": "https://registry.npmjs.org/shot/-/shot-3.4.2.tgz",
1228 | "integrity": "sha1-Hlw/bysmZJrcQvfrNQIUpaApHWc=",
1229 | "dev": true,
1230 | "requires": {
1231 | "hoek": "4.x.x",
1232 | "joi": "10.x.x"
1233 | },
1234 | "dependencies": {
1235 | "joi": {
1236 | "version": "10.6.0",
1237 | "resolved": "https://registry.npmjs.org/joi/-/joi-10.6.0.tgz",
1238 | "integrity": "sha512-hBF3LcqyAid+9X/pwg+eXjD2QBZI5eXnBFJYaAkH4SK3mp9QSRiiQnDYlmlz5pccMvnLcJRS4whhDOTCkmsAdQ==",
1239 | "dev": true,
1240 | "requires": {
1241 | "hoek": "4.x.x",
1242 | "isemail": "2.x.x",
1243 | "items": "2.x.x",
1244 | "topo": "2.x.x"
1245 | }
1246 | }
1247 | }
1248 | },
1249 | "source-map": {
1250 | "version": "0.5.7",
1251 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
1252 | "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
1253 | "dev": true
1254 | },
1255 | "source-map-support": {
1256 | "version": "0.5.9",
1257 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.9.tgz",
1258 | "integrity": "sha512-gR6Rw4MvUlYy83vP0vxoVNzM6t8MUXqNuRsuBmBHQDu1Fh6X015FrLdgoDKcNdkwGubozq0P4N0Q37UyFVr1EA==",
1259 | "dev": true,
1260 | "requires": {
1261 | "buffer-from": "^1.0.0",
1262 | "source-map": "^0.6.0"
1263 | },
1264 | "dependencies": {
1265 | "source-map": {
1266 | "version": "0.6.1",
1267 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
1268 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
1269 | "dev": true
1270 | }
1271 | }
1272 | },
1273 | "statehood": {
1274 | "version": "4.1.0",
1275 | "resolved": "https://registry.npmjs.org/statehood/-/statehood-4.1.0.tgz",
1276 | "integrity": "sha1-iih30T2YUKq2zod6VLd43w9DrNs=",
1277 | "dev": true,
1278 | "requires": {
1279 | "boom": "3.x.x",
1280 | "cryptiles": "3.x.x",
1281 | "hoek": "4.x.x",
1282 | "iron": "4.x.x",
1283 | "items": "2.x.x",
1284 | "joi": "9.x.x"
1285 | },
1286 | "dependencies": {
1287 | "boom": {
1288 | "version": "3.2.2",
1289 | "resolved": "https://registry.npmjs.org/boom/-/boom-3.2.2.tgz",
1290 | "integrity": "sha1-DwzF0ErcUAO4x9cfQsynJx/vDng=",
1291 | "dev": true,
1292 | "requires": {
1293 | "hoek": "4.x.x"
1294 | }
1295 | },
1296 | "cryptiles": {
1297 | "version": "3.1.4",
1298 | "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.4.tgz",
1299 | "integrity": "sha512-8I1sgZHfVwcSOY6mSGpVU3lw/GSIZvusg8dD2+OGehCJpOhQRLNcH0qb9upQnOH4XhgxxFJSg6E2kx95deb1Tw==",
1300 | "dev": true,
1301 | "requires": {
1302 | "boom": "5.x.x"
1303 | },
1304 | "dependencies": {
1305 | "boom": {
1306 | "version": "5.2.0",
1307 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
1308 | "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
1309 | "dev": true,
1310 | "requires": {
1311 | "hoek": "4.x.x"
1312 | }
1313 | }
1314 | }
1315 | }
1316 | }
1317 | },
1318 | "subtext": {
1319 | "version": "4.4.1",
1320 | "resolved": "https://registry.npmjs.org/subtext/-/subtext-4.4.1.tgz",
1321 | "integrity": "sha1-L87JRd5CkoPD0YsVH/D6HxuHrsk=",
1322 | "dev": true,
1323 | "requires": {
1324 | "boom": "5.x.x",
1325 | "content": "3.x.x",
1326 | "hoek": "4.x.x",
1327 | "pez": "2.x.x",
1328 | "wreck": "12.x.x"
1329 | },
1330 | "dependencies": {
1331 | "boom": {
1332 | "version": "5.2.0",
1333 | "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
1334 | "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
1335 | "dev": true,
1336 | "requires": {
1337 | "hoek": "4.x.x"
1338 | }
1339 | },
1340 | "wreck": {
1341 | "version": "12.5.1",
1342 | "resolved": "https://registry.npmjs.org/wreck/-/wreck-12.5.1.tgz",
1343 | "integrity": "sha512-l5DUGrc+yDyIflpty1x9XuMj1ehVjC/dTbF3/BasOO77xk0EdEa4M/DuOY8W88MQDAD0fEDqyjc8bkIMHd2E9A==",
1344 | "dev": true,
1345 | "requires": {
1346 | "boom": "5.x.x",
1347 | "hoek": "4.x.x"
1348 | }
1349 | }
1350 | }
1351 | },
1352 | "supports-color": {
1353 | "version": "5.5.0",
1354 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
1355 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
1356 | "dev": true,
1357 | "requires": {
1358 | "has-flag": "^3.0.0"
1359 | }
1360 | },
1361 | "tar": {
1362 | "version": "2.2.1",
1363 | "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz",
1364 | "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=",
1365 | "requires": {
1366 | "block-stream": "*",
1367 | "fstream": "^1.0.2",
1368 | "inherits": "2"
1369 | }
1370 | },
1371 | "to-fast-properties": {
1372 | "version": "2.0.0",
1373 | "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
1374 | "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
1375 | "dev": true
1376 | },
1377 | "topo": {
1378 | "version": "2.0.2",
1379 | "resolved": "http://registry.npmjs.org/topo/-/topo-2.0.2.tgz",
1380 | "integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=",
1381 | "dev": true,
1382 | "requires": {
1383 | "hoek": "4.x.x"
1384 | }
1385 | },
1386 | "trim-right": {
1387 | "version": "1.0.1",
1388 | "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz",
1389 | "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=",
1390 | "dev": true
1391 | },
1392 | "url": {
1393 | "version": "0.10.3",
1394 | "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz",
1395 | "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=",
1396 | "requires": {
1397 | "punycode": "1.3.2",
1398 | "querystring": "0.2.0"
1399 | }
1400 | },
1401 | "uuid": {
1402 | "version": "3.1.0",
1403 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz",
1404 | "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g=="
1405 | },
1406 | "velocityjs": {
1407 | "version": "1.1.3",
1408 | "resolved": "https://registry.npmjs.org/velocityjs/-/velocityjs-1.1.3.tgz",
1409 | "integrity": "sha512-7cC2jgKt6AuSaAaJvvTkFFLuYJzKWTYHldPcRVCqR8e6bbx8iOweSTMcTjOmY/RedgINrlWG5m/SZxHJGna8CQ==",
1410 | "dev": true
1411 | },
1412 | "vise": {
1413 | "version": "2.0.2",
1414 | "resolved": "http://registry.npmjs.org/vise/-/vise-2.0.2.tgz",
1415 | "integrity": "sha1-awjo+0y3bjpQzW3Q7DczjoEaDTk=",
1416 | "dev": true,
1417 | "requires": {
1418 | "hoek": "4.x.x"
1419 | }
1420 | },
1421 | "wrappy": {
1422 | "version": "1.0.2",
1423 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
1424 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
1425 | },
1426 | "wreck": {
1427 | "version": "9.0.0",
1428 | "resolved": "http://registry.npmjs.org/wreck/-/wreck-9.0.0.tgz",
1429 | "integrity": "sha1-HeY9SbsHuU/nGIZLi+YxduYzMew=",
1430 | "dev": true,
1431 | "requires": {
1432 | "boom": "3.x.x",
1433 | "hoek": "4.x.x"
1434 | },
1435 | "dependencies": {
1436 | "boom": {
1437 | "version": "3.2.2",
1438 | "resolved": "https://registry.npmjs.org/boom/-/boom-3.2.2.tgz",
1439 | "integrity": "sha1-DwzF0ErcUAO4x9cfQsynJx/vDng=",
1440 | "dev": true,
1441 | "requires": {
1442 | "hoek": "4.x.x"
1443 | }
1444 | }
1445 | }
1446 | },
1447 | "xml2js": {
1448 | "version": "0.4.19",
1449 | "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
1450 | "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
1451 | "requires": {
1452 | "sax": ">=0.6.0",
1453 | "xmlbuilder": "~9.0.1"
1454 | }
1455 | },
1456 | "xmlbuilder": {
1457 | "version": "9.0.7",
1458 | "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
1459 | "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
1460 | }
1461 | }
1462 | }
1463 |
--------------------------------------------------------------------------------
/api/todo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "api",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "Manoj Fernando ",
10 | "license": "MIT",
11 | "dependencies": {
12 | "aws-sdk": "2.384.0",
13 | "bluebird": "3.5.3"
14 | },
15 | "devDependencies": {
16 | "serverless-offline": "3.31.3",
17 | "serverless-dynamodb-local": "^0.2.30"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/api/todo/serverless.yml:
--------------------------------------------------------------------------------
1 | service: todo
2 | frameworkVersion: "=1.35.1"
3 |
4 | provider:
5 | name: aws
6 | runtime: nodejs6.10
7 | profile: tromesh # AWS CLI profile name
8 | stage: dev
9 | region: us-east-1
10 | iamRoleStatements:
11 | - Effect: "Allow"
12 | Action:
13 | - "dynamodb:*"
14 | Resource:
15 | - "arn:aws:dynamodb:*:*"
16 | environment:
17 | APP_SECRET: ${file(./config.yml):${self:custom.stage}.APP_SECRET}
18 | DB_PREFIX: ${file(./config.yml):${self:custom.stage}.DB_PREFIX}
19 |
20 | plugins:
21 | - serverless-dynamodb-local
22 | - serverless-offline
23 |
24 | custom:
25 | stage: ${opt:stage, self:provider.stage}
26 | DB_PREFIX: ${file(./config.yml):${self:custom.stage}.DB_PREFIX}
27 | dynamodb:
28 | start:
29 | port: 8000
30 | inMemory: true
31 | migrate: true
32 | seed: true
33 | seed:
34 | domain:
35 | sources:
36 | - table: ${self:custom.DB_PREFIX}-todos
37 | sources: [./offline/migrations/todo-seed.json]
38 |
39 | functions:
40 | getAllTodos:
41 | handler: handler.getAllTodos
42 | events:
43 | - http:
44 | method: GET
45 | path: todos/getAll
46 | cors: true
47 |
48 | createTodo:
49 | handler: handler.createTodo
50 | events:
51 | - http:
52 | method: POST
53 | path: todos
54 | cors: true
55 |
56 | updateTodo:
57 | handler: handler.updateTodo
58 | events:
59 | - http:
60 | method: PUT
61 | path: todos/update
62 | cors: true
63 |
64 | updateTodoStatus:
65 | handler: handler.updateTodoStatus
66 | events:
67 | - http:
68 | method: PUT
69 | path: todos/status
70 | cors: true
71 |
72 | deleteTodo:
73 | handler: handler.deleteTodo
74 | events:
75 | - http:
76 | method: DELETE
77 | path: todos/delete/{id}
78 | cors: true
79 |
80 | resources:
81 | Resources: ${file(offline/migrations/todo.yml)}
82 |
83 | package:
84 | exclude:
85 | - node_modules/dynamodb-localhost/**
86 | - node_modules/serverless-dynamodb-local/**
87 | - node_modules/serverless-offline/**
88 |
89 |
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | let gulp = require("gulp"),
2 | isWin = /^win/.test(process.platform),
3 | commandSeparator = isWin ? "&" : ";",
4 | webpack = require("webpack"),
5 | exec = require("child_process").exec,
6 | stage = null;
7 |
8 | function runCommand(cmd, done) {
9 | let ls = exec(cmd);
10 | ls.stdout.on("data", function(data) {
11 | console.log(data);
12 | });
13 | ls.stderr.on("data", function(data) {
14 | console.log(data);
15 | });
16 | ls.on("close", function(data) {
17 | done && done();
18 | });
19 | }
20 |
21 | /* Install dynamodb local instance */
22 | gulp.task("install-dynamodb", function(done) {
23 | runCommand("cd api" + commandSeparator + " sls dynamodb install", done);
24 | });
25 |
26 | /* Start dynamodb local instance */
27 | gulp.task("start-dynamodb", function(done) {
28 | runCommand("cd api" + commandSeparator + " sls dynamodb start", done);
29 | });
30 |
31 | /* Start offline server for local development */
32 | gulp.task("start-offline-server", function(done) {
33 | runCommand(
34 | "cd api " +
35 | commandSeparator +
36 | "cd todo " +
37 | commandSeparator +
38 | "serverless offline start",
39 | done
40 | );
41 | });
42 |
43 | /* Start offline server for local development */
44 | gulp.task("start-client", function(done) {
45 | runCommand("cd web " + commandSeparator + "npm run start", done);
46 | });
47 |
48 | /* Start application locally */
49 | gulp.task("serve", gulp.parallel("start-offline-server", "start-client"));
50 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "serverless-boilerplate",
3 | "version": "2.0.0",
4 | "description": "basic boilerplate with offline development setup",
5 | "main": "index.js",
6 | "dependencies": {
7 | "gulp": "4.0.0",
8 | "gulp-exec": "3.0.2",
9 | "gulp-sequence": "1.0.0",
10 | "gulp-util": "3.0.7",
11 | "i": "0.3.5",
12 | "webpack": "4.19.1"
13 | },
14 | "scripts": {
15 | "preinstall": "cd web && npm install",
16 | "postinstall": "cd api && cd todo && npm install",
17 | "db-setup": "cd api && cd todo && sls dynamodb install",
18 | "db-remove": "cd api && cd todo && sls dynamodb remove",
19 | "predeploy-s3": "cd web && npm run build",
20 | "deploy-s3": "cd web && aws s3 --profile sync ./build/ s3:// --region ",
21 | "app": "gulp serve"
22 | },
23 | "repository": {
24 | "type": "git",
25 | "url": "git+https://github.com/mjzone/serverless-boilerplate.git"
26 | },
27 | "keywords": [
28 | "serverless",
29 | "boilerplate",
30 | "aws",
31 | "offline"
32 | ],
33 | "author": "Manoj Fernando ",
34 | "license": "MIT",
35 | "bugs": {
36 | "url": "https://github.com/mjzone/serverless-boilerplate/issues"
37 | },
38 | "homepage": "https://github.com/mjzone/serverless-boilerplate#readme",
39 | "devDependencies": {}
40 | }
41 |
--------------------------------------------------------------------------------
/web/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 |
6 | # testing
7 | /coverage
8 |
9 | # production
10 | /build
11 |
12 | # misc
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 |
19 | npm-debug.log*
20 | yarn-debug.log*
21 | yarn-error.log*
22 |
--------------------------------------------------------------------------------
/web/README.md:
--------------------------------------------------------------------------------
1 | This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).
2 |
3 | Below you will find some information on how to perform common tasks.
4 | You can find the most recent version of this guide [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md).
5 |
6 | ## Table of Contents
7 |
8 | - [Updating to New Releases](#updating-to-new-releases)
9 | - [Sending Feedback](#sending-feedback)
10 | - [Folder Structure](#folder-structure)
11 | - [Available Scripts](#available-scripts)
12 | - [npm start](#npm-start)
13 | - [npm test](#npm-test)
14 | - [npm run build](#npm-run-build)
15 | - [npm run eject](#npm-run-eject)
16 | - [Supported Browsers](#supported-browsers)
17 | - [Supported Language Features and Polyfills](#supported-language-features-and-polyfills)
18 | - [Syntax Highlighting in the Editor](#syntax-highlighting-in-the-editor)
19 | - [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor)
20 | - [Debugging in the Editor](#debugging-in-the-editor)
21 | - [Formatting Code Automatically](#formatting-code-automatically)
22 | - [Changing the Page ``](#changing-the-page-title)
23 | - [Installing a Dependency](#installing-a-dependency)
24 | - [Importing a Component](#importing-a-component)
25 | - [Code Splitting](#code-splitting)
26 | - [Adding a Stylesheet](#adding-a-stylesheet)
27 | - [Post-Processing CSS](#post-processing-css)
28 | - [Adding a CSS Preprocessor (Sass, Less etc.)](#adding-a-css-preprocessor-sass-less-etc)
29 | - [Adding Images, Fonts, and Files](#adding-images-fonts-and-files)
30 | - [Using the `public` Folder](#using-the-public-folder)
31 | - [Changing the HTML](#changing-the-html)
32 | - [Adding Assets Outside of the Module System](#adding-assets-outside-of-the-module-system)
33 | - [When to Use the `public` Folder](#when-to-use-the-public-folder)
34 | - [Using Global Variables](#using-global-variables)
35 | - [Adding Bootstrap](#adding-bootstrap)
36 | - [Using a Custom Theme](#using-a-custom-theme)
37 | - [Adding Flow](#adding-flow)
38 | - [Adding a Router](#adding-a-router)
39 | - [Adding Custom Environment Variables](#adding-custom-environment-variables)
40 | - [Referencing Environment Variables in the HTML](#referencing-environment-variables-in-the-html)
41 | - [Adding Temporary Environment Variables In Your Shell](#adding-temporary-environment-variables-in-your-shell)
42 | - [Adding Development Environment Variables In `.env`](#adding-development-environment-variables-in-env)
43 | - [Can I Use Decorators?](#can-i-use-decorators)
44 | - [Fetching Data with AJAX Requests](#fetching-data-with-ajax-requests)
45 | - [Integrating with an API Backend](#integrating-with-an-api-backend)
46 | - [Node](#node)
47 | - [Ruby on Rails](#ruby-on-rails)
48 | - [Proxying API Requests in Development](#proxying-api-requests-in-development)
49 | - ["Invalid Host Header" Errors After Configuring Proxy](#invalid-host-header-errors-after-configuring-proxy)
50 | - [Configuring the Proxy Manually](#configuring-the-proxy-manually)
51 | - [Configuring a WebSocket Proxy](#configuring-a-websocket-proxy)
52 | - [Using HTTPS in Development](#using-https-in-development)
53 | - [Generating Dynamic `` Tags on the Server](#generating-dynamic-meta-tags-on-the-server)
54 | - [Pre-Rendering into Static HTML Files](#pre-rendering-into-static-html-files)
55 | - [Injecting Data from the Server into the Page](#injecting-data-from-the-server-into-the-page)
56 | - [Running Tests](#running-tests)
57 | - [Filename Conventions](#filename-conventions)
58 | - [Command Line Interface](#command-line-interface)
59 | - [Version Control Integration](#version-control-integration)
60 | - [Writing Tests](#writing-tests)
61 | - [Testing Components](#testing-components)
62 | - [Using Third Party Assertion Libraries](#using-third-party-assertion-libraries)
63 | - [Initializing Test Environment](#initializing-test-environment)
64 | - [Focusing and Excluding Tests](#focusing-and-excluding-tests)
65 | - [Coverage Reporting](#coverage-reporting)
66 | - [Continuous Integration](#continuous-integration)
67 | - [Disabling jsdom](#disabling-jsdom)
68 | - [Snapshot Testing](#snapshot-testing)
69 | - [Editor Integration](#editor-integration)
70 | - [Debugging Tests](#debugging-tests)
71 | - [Debugging Tests in Chrome](#debugging-tests-in-chrome)
72 | - [Debugging Tests in Visual Studio Code](#debugging-tests-in-visual-studio-code)
73 | - [Developing Components in Isolation](#developing-components-in-isolation)
74 | - [Getting Started with Storybook](#getting-started-with-storybook)
75 | - [Getting Started with Styleguidist](#getting-started-with-styleguidist)
76 | - [Publishing Components to npm](#publishing-components-to-npm)
77 | - [Making a Progressive Web App](#making-a-progressive-web-app)
78 | - [Opting Out of Caching](#opting-out-of-caching)
79 | - [Offline-First Considerations](#offline-first-considerations)
80 | - [Progressive Web App Metadata](#progressive-web-app-metadata)
81 | - [Analyzing the Bundle Size](#analyzing-the-bundle-size)
82 | - [Deployment](#deployment)
83 | - [Static Server](#static-server)
84 | - [Other Solutions](#other-solutions)
85 | - [Serving Apps with Client-Side Routing](#serving-apps-with-client-side-routing)
86 | - [Building for Relative Paths](#building-for-relative-paths)
87 | - [Azure](#azure)
88 | - [Firebase](#firebase)
89 | - [GitHub Pages](#github-pages)
90 | - [Heroku](#heroku)
91 | - [Netlify](#netlify)
92 | - [Now](#now)
93 | - [S3 and CloudFront](#s3-and-cloudfront)
94 | - [Surge](#surge)
95 | - [Advanced Configuration](#advanced-configuration)
96 | - [Troubleshooting](#troubleshooting)
97 | - [`npm start` doesn’t detect changes](#npm-start-doesnt-detect-changes)
98 | - [`npm test` hangs on macOS Sierra](#npm-test-hangs-on-macos-sierra)
99 | - [`npm run build` exits too early](#npm-run-build-exits-too-early)
100 | - [`npm run build` fails on Heroku](#npm-run-build-fails-on-heroku)
101 | - [`npm run build` fails to minify](#npm-run-build-fails-to-minify)
102 | - [Moment.js locales are missing](#momentjs-locales-are-missing)
103 | - [Alternatives to Ejecting](#alternatives-to-ejecting)
104 | - [Something Missing?](#something-missing)
105 |
106 | ## Updating to New Releases
107 |
108 | Create React App is divided into two packages:
109 |
110 | * `create-react-app` is a global command-line utility that you use to create new projects.
111 | * `react-scripts` is a development dependency in the generated projects (including this one).
112 |
113 | You almost never need to update `create-react-app` itself: it delegates all the setup to `react-scripts`.
114 |
115 | When you run `create-react-app`, it always creates the project with the latest version of `react-scripts` so you’ll get all the new features and improvements in newly created apps automatically.
116 |
117 | To update an existing project to a new version of `react-scripts`, [open the changelog](https://github.com/facebookincubator/create-react-app/blob/master/CHANGELOG.md), find the version you’re currently on (check `package.json` in this folder if you’re not sure), and apply the migration instructions for the newer versions.
118 |
119 | In most cases bumping the `react-scripts` version in `package.json` and running `npm install` in this folder should be enough, but it’s good to consult the [changelog](https://github.com/facebookincubator/create-react-app/blob/master/CHANGELOG.md) for potential breaking changes.
120 |
121 | We commit to keeping the breaking changes minimal so you can upgrade `react-scripts` painlessly.
122 |
123 | ## Sending Feedback
124 |
125 | We are always open to [your feedback](https://github.com/facebookincubator/create-react-app/issues).
126 |
127 | ## Folder Structure
128 |
129 | After creation, your project should look like this:
130 |
131 | ```
132 | my-app/
133 | README.md
134 | node_modules/
135 | package.json
136 | public/
137 | index.html
138 | favicon.ico
139 | src/
140 | App.css
141 | App.js
142 | App.test.js
143 | index.css
144 | index.js
145 | logo.svg
146 | ```
147 |
148 | For the project to build, **these files must exist with exact filenames**:
149 |
150 | * `public/index.html` is the page template;
151 | * `src/index.js` is the JavaScript entry point.
152 |
153 | You can delete or rename the other files.
154 |
155 | You may create subdirectories inside `src`. For faster rebuilds, only files inside `src` are processed by Webpack.
156 | You need to **put any JS and CSS files inside `src`**, otherwise Webpack won’t see them.
157 |
158 | Only files inside `public` can be used from `public/index.html`.
159 | Read instructions below for using assets from JavaScript and HTML.
160 |
161 | You can, however, create more top-level directories.
162 | They will not be included in the production build so you can use them for things like documentation.
163 |
164 | ## Available Scripts
165 |
166 | In the project directory, you can run:
167 |
168 | ### `npm start`
169 |
170 | Runs the app in the development mode.
171 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
172 |
173 | The page will reload if you make edits.
174 | You will also see any lint errors in the console.
175 |
176 | ### `npm test`
177 |
178 | Launches the test runner in the interactive watch mode.
179 | See the section about [running tests](#running-tests) for more information.
180 |
181 | ### `npm run build`
182 |
183 | Builds the app for production to the `build` folder.
184 | It correctly bundles React in production mode and optimizes the build for the best performance.
185 |
186 | The build is minified and the filenames include the hashes.
187 | Your app is ready to be deployed!
188 |
189 | See the section about [deployment](#deployment) for more information.
190 |
191 | ### `npm run eject`
192 |
193 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
194 |
195 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
196 |
197 | Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
198 |
199 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
200 |
201 | ## Supported Browsers
202 |
203 | By default, the generated project uses the latest version of React.
204 |
205 | You can refer [to the React documentation](https://reactjs.org/docs/react-dom.html#browser-support) for more information about supported browsers.
206 |
207 | ## Supported Language Features and Polyfills
208 |
209 | This project supports a superset of the latest JavaScript standard.
210 | In addition to [ES6](https://github.com/lukehoban/es6features) syntax features, it also supports:
211 |
212 | * [Exponentiation Operator](https://github.com/rwaldron/exponentiation-operator) (ES2016).
213 | * [Async/await](https://github.com/tc39/ecmascript-asyncawait) (ES2017).
214 | * [Object Rest/Spread Properties](https://github.com/sebmarkbage/ecmascript-rest-spread) (stage 3 proposal).
215 | * [Dynamic import()](https://github.com/tc39/proposal-dynamic-import) (stage 3 proposal)
216 | * [Class Fields and Static Properties](https://github.com/tc39/proposal-class-public-fields) (part of stage 3 proposal).
217 | * [JSX](https://facebook.github.io/react/docs/introducing-jsx.html) and [Flow](https://flowtype.org/) syntax.
218 |
219 | Learn more about [different proposal stages](https://babeljs.io/docs/plugins/#presets-stage-x-experimental-presets-).
220 |
221 | While we recommend using experimental proposals with some caution, Facebook heavily uses these features in the product code, so we intend to provide [codemods](https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb) if any of these proposals change in the future.
222 |
223 | Note that **the project only includes a few ES6 [polyfills](https://en.wikipedia.org/wiki/Polyfill)**:
224 |
225 | * [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) via [`object-assign`](https://github.com/sindresorhus/object-assign).
226 | * [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) via [`promise`](https://github.com/then/promise).
227 | * [`fetch()`](https://developer.mozilla.org/en/docs/Web/API/Fetch_API) via [`whatwg-fetch`](https://github.com/github/fetch).
228 |
229 | If you use any other ES6+ features that need **runtime support** (such as `Array.from()` or `Symbol`), make sure you are including the appropriate polyfills manually, or that the browsers you are targeting already support them.
230 |
231 | Also note that using some newer syntax features like `for...of` or `[...nonArrayValue]` causes Babel to emit code that depends on ES6 runtime features and might not work without a polyfill. When in doubt, use [Babel REPL](https://babeljs.io/repl/) to see what any specific syntax compiles down to.
232 |
233 | ## Syntax Highlighting in the Editor
234 |
235 | To configure the syntax highlighting in your favorite text editor, head to the [relevant Babel documentation page](https://babeljs.io/docs/editors) and follow the instructions. Some of the most popular editors are covered.
236 |
237 | ## Displaying Lint Output in the Editor
238 |
239 | >Note: this feature is available with `react-scripts@0.2.0` and higher.
240 | >It also only works with npm 3 or higher.
241 |
242 | Some editors, including Sublime Text, Atom, and Visual Studio Code, provide plugins for ESLint.
243 |
244 | They are not required for linting. You should see the linter output right in your terminal as well as the browser console. However, if you prefer the lint results to appear right in your editor, there are some extra steps you can do.
245 |
246 | You would need to install an ESLint plugin for your editor first. Then, add a file called `.eslintrc` to the project root:
247 |
248 | ```js
249 | {
250 | "extends": "react-app"
251 | }
252 | ```
253 |
254 | Now your editor should report the linting warnings.
255 |
256 | Note that even if you edit your `.eslintrc` file further, these changes will **only affect the editor integration**. They won’t affect the terminal and in-browser lint output. This is because Create React App intentionally provides a minimal set of rules that find common mistakes.
257 |
258 | If you want to enforce a coding style for your project, consider using [Prettier](https://github.com/jlongster/prettier) instead of ESLint style rules.
259 |
260 | ## Debugging in the Editor
261 |
262 | **This feature is currently only supported by [Visual Studio Code](https://code.visualstudio.com) and [WebStorm](https://www.jetbrains.com/webstorm/).**
263 |
264 | Visual Studio Code and WebStorm support debugging out of the box with Create React App. This enables you as a developer to write and debug your React code without leaving the editor, and most importantly it enables you to have a continuous development workflow, where context switching is minimal, as you don’t have to switch between tools.
265 |
266 | ### Visual Studio Code
267 |
268 | You would need to have the latest version of [VS Code](https://code.visualstudio.com) and VS Code [Chrome Debugger Extension](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) installed.
269 |
270 | Then add the block below to your `launch.json` file and put it inside the `.vscode` folder in your app’s root directory.
271 |
272 | ```json
273 | {
274 | "version": "0.2.0",
275 | "configurations": [{
276 | "name": "Chrome",
277 | "type": "chrome",
278 | "request": "launch",
279 | "url": "http://localhost:3000",
280 | "webRoot": "${workspaceRoot}/src",
281 | "sourceMapPathOverrides": {
282 | "webpack:///src/*": "${webRoot}/*"
283 | }
284 | }]
285 | }
286 | ```
287 | >Note: the URL may be different if you've made adjustments via the [HOST or PORT environment variables](#advanced-configuration).
288 |
289 | Start your app by running `npm start`, and start debugging in VS Code by pressing `F5` or by clicking the green debug icon. You can now write code, set breakpoints, make changes to the code, and debug your newly modified code—all from your editor.
290 |
291 | Having problems with VS Code Debugging? Please see their [troubleshooting guide](https://github.com/Microsoft/vscode-chrome-debug/blob/master/README.md#troubleshooting).
292 |
293 | ### WebStorm
294 |
295 | You would need to have [WebStorm](https://www.jetbrains.com/webstorm/) and [JetBrains IDE Support](https://chrome.google.com/webstore/detail/jetbrains-ide-support/hmhgeddbohgjknpmjagkdomcpobmllji) Chrome extension installed.
296 |
297 | In the WebStorm menu `Run` select `Edit Configurations...`. Then click `+` and select `JavaScript Debug`. Paste `http://localhost:3000` into the URL field and save the configuration.
298 |
299 | >Note: the URL may be different if you've made adjustments via the [HOST or PORT environment variables](#advanced-configuration).
300 |
301 | Start your app by running `npm start`, then press `^D` on macOS or `F9` on Windows and Linux or click the green debug icon to start debugging in WebStorm.
302 |
303 | The same way you can debug your application in IntelliJ IDEA Ultimate, PhpStorm, PyCharm Pro, and RubyMine.
304 |
305 | ## Formatting Code Automatically
306 |
307 | Prettier is an opinionated code formatter with support for JavaScript, CSS and JSON. With Prettier you can format the code you write automatically to ensure a code style within your project. See the [Prettier's GitHub page](https://github.com/prettier/prettier) for more information, and look at this [page to see it in action](https://prettier.github.io/prettier/).
308 |
309 | To format our code whenever we make a commit in git, we need to install the following dependencies:
310 |
311 | ```sh
312 | npm install --save husky lint-staged prettier
313 | ```
314 |
315 | Alternatively you may use `yarn`:
316 |
317 | ```sh
318 | yarn add husky lint-staged prettier
319 | ```
320 |
321 | * `husky` makes it easy to use githooks as if they are npm scripts.
322 | * `lint-staged` allows us to run scripts on staged files in git. See this [blog post about lint-staged to learn more about it](https://medium.com/@okonetchnikov/make-linting-great-again-f3890e1ad6b8).
323 | * `prettier` is the JavaScript formatter we will run before commits.
324 |
325 | Now we can make sure every file is formatted correctly by adding a few lines to the `package.json` in the project root.
326 |
327 | Add the following line to `scripts` section:
328 |
329 | ```diff
330 | "scripts": {
331 | + "precommit": "lint-staged",
332 | "start": "react-scripts start",
333 | "build": "react-scripts build",
334 | ```
335 |
336 | Next we add a 'lint-staged' field to the `package.json`, for example:
337 |
338 | ```diff
339 | "dependencies": {
340 | // ...
341 | },
342 | + "lint-staged": {
343 | + "src/**/*.{js,jsx,json,css}": [
344 | + "prettier --single-quote --write",
345 | + "git add"
346 | + ]
347 | + },
348 | "scripts": {
349 | ```
350 |
351 | Now, whenever you make a commit, Prettier will format the changed files automatically. You can also run `./node_modules/.bin/prettier --single-quote --write "src/**/*.{js,jsx,json,css}"` to format your entire project for the first time.
352 |
353 | Next you might want to integrate Prettier in your favorite editor. Read the section on [Editor Integration](https://prettier.io/docs/en/editors.html) on the Prettier GitHub page.
354 |
355 | ## Changing the Page ``
356 |
357 | You can find the source HTML file in the `public` folder of the generated project. You may edit the `` tag in it to change the title from “React App” to anything else.
358 |
359 | Note that normally you wouldn’t edit files in the `public` folder very often. For example, [adding a stylesheet](#adding-a-stylesheet) is done without touching the HTML.
360 |
361 | If you need to dynamically update the page title based on the content, you can use the browser [`document.title`](https://developer.mozilla.org/en-US/docs/Web/API/Document/title) API. For more complex scenarios when you want to change the title from React components, you can use [React Helmet](https://github.com/nfl/react-helmet), a third party library.
362 |
363 | If you use a custom server for your app in production and want to modify the title before it gets sent to the browser, you can follow advice in [this section](#generating-dynamic-meta-tags-on-the-server). Alternatively, you can pre-build each page as a static HTML file which then loads the JavaScript bundle, which is covered [here](#pre-rendering-into-static-html-files).
364 |
365 | ## Installing a Dependency
366 |
367 | The generated project includes React and ReactDOM as dependencies. It also includes a set of scripts used by Create React App as a development dependency. You may install other dependencies (for example, React Router) with `npm`:
368 |
369 | ```sh
370 | npm install --save react-router
371 | ```
372 |
373 | Alternatively you may use `yarn`:
374 |
375 | ```sh
376 | yarn add react-router
377 | ```
378 |
379 | This works for any library, not just `react-router`.
380 |
381 | ## Importing a Component
382 |
383 | This project setup supports ES6 modules thanks to Babel.
384 | While you can still use `require()` and `module.exports`, we encourage you to use [`import` and `export`](http://exploringjs.com/es6/ch_modules.html) instead.
385 |
386 | For example:
387 |
388 | ### `Button.js`
389 |
390 | ```js
391 | import React, { Component } from 'react';
392 |
393 | class Button extends Component {
394 | render() {
395 | // ...
396 | }
397 | }
398 |
399 | export default Button; // Don’t forget to use export default!
400 | ```
401 |
402 | ### `DangerButton.js`
403 |
404 |
405 | ```js
406 | import React, { Component } from 'react';
407 | import Button from './Button'; // Import a component from another file
408 |
409 | class DangerButton extends Component {
410 | render() {
411 | return ;
412 | }
413 | }
414 |
415 | export default DangerButton;
416 | ```
417 |
418 | Be aware of the [difference between default and named exports](http://stackoverflow.com/questions/36795819/react-native-es-6-when-should-i-use-curly-braces-for-import/36796281#36796281). It is a common source of mistakes.
419 |
420 | We suggest that you stick to using default imports and exports when a module only exports a single thing (for example, a component). That’s what you get when you use `export default Button` and `import Button from './Button'`.
421 |
422 | Named exports are useful for utility modules that export several functions. A module may have at most one default export and as many named exports as you like.
423 |
424 | Learn more about ES6 modules:
425 |
426 | * [When to use the curly braces?](http://stackoverflow.com/questions/36795819/react-native-es-6-when-should-i-use-curly-braces-for-import/36796281#36796281)
427 | * [Exploring ES6: Modules](http://exploringjs.com/es6/ch_modules.html)
428 | * [Understanding ES6: Modules](https://leanpub.com/understandinges6/read#leanpub-auto-encapsulating-code-with-modules)
429 |
430 | ## Code Splitting
431 |
432 | Instead of downloading the entire app before users can use it, code splitting allows you to split your code into small chunks which you can then load on demand.
433 |
434 | This project setup supports code splitting via [dynamic `import()`](http://2ality.com/2017/01/import-operator.html#loading-code-on-demand). Its [proposal](https://github.com/tc39/proposal-dynamic-import) is in stage 3. The `import()` function-like form takes the module name as an argument and returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) which always resolves to the namespace object of the module.
435 |
436 | Here is an example:
437 |
438 | ### `moduleA.js`
439 |
440 | ```js
441 | const moduleA = 'Hello';
442 |
443 | export { moduleA };
444 | ```
445 | ### `App.js`
446 |
447 | ```js
448 | import React, { Component } from 'react';
449 |
450 | class App extends Component {
451 | handleClick = () => {
452 | import('./moduleA')
453 | .then(({ moduleA }) => {
454 | // Use moduleA
455 | })
456 | .catch(err => {
457 | // Handle failure
458 | });
459 | };
460 |
461 | render() {
462 | return (
463 |
464 |
465 |
466 | );
467 | }
468 | }
469 |
470 | export default App;
471 | ```
472 |
473 | This will make `moduleA.js` and all its unique dependencies as a separate chunk that only loads after the user clicks the 'Load' button.
474 |
475 | You can also use it with `async` / `await` syntax if you prefer it.
476 |
477 | ### With React Router
478 |
479 | If you are using React Router check out [this tutorial](http://serverless-stack.com/chapters/code-splitting-in-create-react-app.html) on how to use code splitting with it. You can find the companion GitHub repository [here](https://github.com/AnomalyInnovations/serverless-stack-demo-client/tree/code-splitting-in-create-react-app).
480 |
481 | Also check out the [Code Splitting](https://reactjs.org/docs/code-splitting.html) section in React documentation.
482 |
483 | ## Adding a Stylesheet
484 |
485 | This project setup uses [Webpack](https://webpack.js.org/) for handling all assets. Webpack offers a custom way of “extending” the concept of `import` beyond JavaScript. To express that a JavaScript file depends on a CSS file, you need to **import the CSS from the JavaScript file**:
486 |
487 | ### `Button.css`
488 |
489 | ```css
490 | .Button {
491 | padding: 20px;
492 | }
493 | ```
494 |
495 | ### `Button.js`
496 |
497 | ```js
498 | import React, { Component } from 'react';
499 | import './Button.css'; // Tell Webpack that Button.js uses these styles
500 |
501 | class Button extends Component {
502 | render() {
503 | // You can use them as regular CSS styles
504 | return ;
505 | }
506 | }
507 | ```
508 |
509 | **This is not required for React** but many people find this feature convenient. You can read about the benefits of this approach [here](https://medium.com/seek-ui-engineering/block-element-modifying-your-javascript-components-d7f99fcab52b). However you should be aware that this makes your code less portable to other build tools and environments than Webpack.
510 |
511 | In development, expressing dependencies this way allows your styles to be reloaded on the fly as you edit them. In production, all CSS files will be concatenated into a single minified `.css` file in the build output.
512 |
513 | If you are concerned about using Webpack-specific semantics, you can put all your CSS right into `src/index.css`. It would still be imported from `src/index.js`, but you could always remove that import if you later migrate to a different build tool.
514 |
515 | ## Post-Processing CSS
516 |
517 | This project setup minifies your CSS and adds vendor prefixes to it automatically through [Autoprefixer](https://github.com/postcss/autoprefixer) so you don’t need to worry about it.
518 |
519 | For example, this:
520 |
521 | ```css
522 | .App {
523 | display: flex;
524 | flex-direction: row;
525 | align-items: center;
526 | }
527 | ```
528 |
529 | becomes this:
530 |
531 | ```css
532 | .App {
533 | display: -webkit-box;
534 | display: -ms-flexbox;
535 | display: flex;
536 | -webkit-box-orient: horizontal;
537 | -webkit-box-direction: normal;
538 | -ms-flex-direction: row;
539 | flex-direction: row;
540 | -webkit-box-align: center;
541 | -ms-flex-align: center;
542 | align-items: center;
543 | }
544 | ```
545 |
546 | If you need to disable autoprefixing for some reason, [follow this section](https://github.com/postcss/autoprefixer#disabling).
547 |
548 | ## Adding a CSS Preprocessor (Sass, Less etc.)
549 |
550 | Generally, we recommend that you don’t reuse the same CSS classes across different components. For example, instead of using a `.Button` CSS class in `` and `` components, we recommend creating a `