aws-classify-server 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -35,6 +35,9 @@ On the client project
|
|
|
35
35
|
```npm install aws-classify-common, aws-classify-client```
|
|
36
36
|
|
|
37
37
|
The framework has been tested with popular client software such as Expo for mobile and React Native for web.
|
|
38
|
+
## Kicking the Tires
|
|
39
|
+
|
|
40
|
+
Because aws-classify involves multiple sub-projects (web, mobile, aws back-end) the best way to get started is to fork or checkout this sample [chat application](https://github.com/selsamman/aws-classify-example-simple-chat) that contains some simple Lambda response classes and a mobile/web front-end.
|
|
38
41
|
|
|
39
42
|
## Calling Lambda Functions from the Client
|
|
40
43
|
|
|
@@ -179,20 +182,17 @@ Root
|
|
|
179
182
|
- node_modules (just bisync)
|
|
180
183
|
- cloud
|
|
181
184
|
- serverless.yml
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
- client-requests (contains request classes implented on the client)
|
|
185
|
+
- requests (request classes)
|
|
186
|
+
- responses (contains implementations of requests from client)
|
|
185
187
|
- web (could be a project created with create-react-app)
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
- client-responses (contains implementation on client)
|
|
188
|
+
- requests (requests)
|
|
189
|
+
- responses (contains implementation of requests from the server)
|
|
189
190
|
- other files pertaining to the client and static website
|
|
190
191
|
```
|
|
191
192
|
You would then configure bisync.json to keep the shared code in sync
|
|
192
193
|
```
|
|
193
194
|
[
|
|
194
|
-
["./cloud/
|
|
195
|
-
["./clout/server-requests", "./web/server-requests"]
|
|
195
|
+
["./cloud/requests", "./web/requests"],
|
|
196
196
|
]
|
|
197
197
|
```
|
|
198
198
|
Implementing shared code this way avoid restrictions that packaging schemes have that effectively require code to be present in project tree
|
|
@@ -304,7 +304,7 @@ resources:
|
|
|
304
304
|
```
|
|
305
305
|
|
|
306
306
|
To deploy you need to:
|
|
307
|
-
- Create AWS credentials using the AWS console as defined in the Serverless [documents](https://www.serverless.com/framework/docs/providers/aws/guide/credentials
|
|
307
|
+
- Create AWS credentials using the AWS console as defined in the Serverless [documents](https://www.serverless.com/framework/docs/providers/aws/guide/credentials)
|
|
308
308
|
- Install and setup credentials You need to setup your credentials with serverless
|
|
309
309
|
```
|
|
310
310
|
serverless config credentials \
|
|
@@ -323,8 +323,13 @@ sls s3sync
|
|
|
323
323
|
serverless deploy stage prod
|
|
324
324
|
sls s3sync
|
|
325
325
|
```
|
|
326
|
+
## Limitations
|
|
327
|
+
* AWS Websockets are limited to 10 minutes
|
|
328
|
+
* No locking mechanism for simultaneous lambda function execution which could cause sessions to be over-ridden with the last one to complete
|
|
329
|
+
* The session key is not periodically updated as the actual database key is used
|
|
330
|
+
* No mechanism to have session alternatives to DynamoDB (for example, REDIS, JWT)
|
|
326
331
|
## Roadmap
|
|
327
|
-
* Create
|
|
332
|
+
* Create template/scripts for getting started (currently starting with chat) sample app is the easiest way to use this library.
|
|
328
333
|
* Continued shakeout with real-world applications
|
|
329
334
|
* Community feedback
|
|
330
335
|
|
package/package.json
CHANGED
|
@@ -50,6 +50,11 @@ Resources:
|
|
|
50
50
|
# https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html
|
|
51
51
|
OriginRequestPolicyId: 88a5eaf4-2fd4-4709-b370-b4c650ea3fcf
|
|
52
52
|
ViewerProtocolPolicy: redirect-to-https
|
|
53
|
+
CustomErrorResponses:
|
|
54
|
+
- ErrorCachingMinTTL: 1
|
|
55
|
+
ErrorCode: 403
|
|
56
|
+
ResponseCode: 200
|
|
57
|
+
ResponsePagePath: "/"
|
|
53
58
|
S3Bucket:
|
|
54
59
|
Type: AWS::S3::Bucket
|
|
55
60
|
Properties:
|
|
@@ -46,6 +46,11 @@ Resources:
|
|
|
46
46
|
# https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-managed-origin-request-policies.html
|
|
47
47
|
OriginRequestPolicyId: 88a5eaf4-2fd4-4709-b370-b4c650ea3fcf
|
|
48
48
|
ViewerProtocolPolicy: redirect-to-https
|
|
49
|
+
CustomErrorResponses:
|
|
50
|
+
- ErrorCachingMinTTL: 1
|
|
51
|
+
ErrorCode: 403
|
|
52
|
+
ResponseCode: 200
|
|
53
|
+
ResponsePagePath: "/"
|
|
49
54
|
S3Bucket:
|
|
50
55
|
Type: AWS::S3::Bucket
|
|
51
56
|
Properties:
|