You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An ambitious ember-cli-deploy plugin for serving Ember FastBoot Applications entirely from within AWS Lambda/API Gateway (assets and all!).
4
6
7
+
5
8
## Background
6
9
API Gateway [now supports the handling binary payloads](https://aws.amazon.com/about-aws/whats-new/2016/11/binary-data-now-supported-by-api-gateway/), which means an end-to-end fastboot hosting solution can now be achieved through API gateway and Lambda without the use of S3 for serving static files. This is what this addon aims to achieve.
7
10
@@ -25,48 +28,66 @@ ember install ember-cli-deploy-fastboot-api-lambda
lambdaFunction: 'my-ember-app', // (Required) Lambda functions name
34
+
region: 'us-east-1', // (Required) Region where lambda is deployed
35
+
36
+
fallbackPath: '/' // (optional) The route that will be attempted if the current route fails. i.e. doesn't exist, fails etc.
37
+
stringyExtensions: [ // (optional) The file extensions that will be treated as text and not binary. Defaults are shown. Any additional items will be concatenated to this list.
38
+
'html',
39
+
'css',
40
+
'js',
41
+
'json',
42
+
'xml',
43
+
'ico',
44
+
'txt',
45
+
'map'
46
+
],
47
+
validAssetPaths: [ // (optional) The assets paths that the lambda is explicitly allow serve. Defaults are shown. Any additional items will be concatenated to this list.
48
+
'/assets/',
49
+
'/robots.txt',
50
+
'/humans.txt',
51
+
'/crossdomain.xml',
52
+
'/sitemap.xml'
53
+
]
33
54
};
34
55
```
35
56
36
57
* Create the lambda function
37
-
38
-
* Open the [AWS Lambda console](https://console.aws.amazon.com/lambda).
39
-
* Select the region that you defined in your deploy variables above.
40
-
* Create a blank lambda, with the name you defined in your deploy variables above.
41
-
* Handler => `index.handler`.
42
-
* Role => `Create a custom role`. Give it a name and use the default policy document.
43
-
* Memory => `128`.
44
-
* Timeout => `30 seconds`.
45
-
* Select `Next` and then select `Create function`.
58
+
59
+
* Open the [AWS Lambda console](https://console.aws.amazon.com/lambda).
60
+
* Select the region that you defined in your deploy variables above.
61
+
* Create a blank lambda, with the name you defined in your deploy variables above.
62
+
* Handler => `index.handler`.
63
+
* Role => `Create a custom role`. Give it a name and use the default policy document.
64
+
* Memory => `128`.
65
+
* Timeout => `30 seconds`.
66
+
* Select `Next` and then select `Create function`.
46
67
47
68
* Create the API Gateway Proxy
48
-
49
-
* Open the [AWS API Gateway console](https://console.aws.amazon.com/apigateway).
50
-
* Select the region that you defined in your deploy variables above.
* Under resources, click `/`, then click `Actions => Create Method`. Select `Any`.
55
-
* Click the `Any label`, choose Integration type `lambda`, check the `Use Lambda Proxy integration` checkbox, and finally select your lambda function's region and name.
56
-
* Create proxy resource:
57
-
* Under resources, click `/`, then click `Actions => Create Resource`. Select `Any`.
58
-
* Select `Configure as proxy resource`, and select `Enable API Gateway CORS`.
59
-
* Select Integration type `Lambda Function Proxy`, and finally select your lambda function's region and name.
60
-
* Under resources, click `Actions => Deploy API`. Select a new stage and give it the name `fastboot`. Hit `Deploy`. You will now see the `Invoke URL`. This is where you site will be hosted.
69
+
70
+
* Open the [AWS API Gateway console](https://console.aws.amazon.com/apigateway).
71
+
* Select the region that you defined in your deploy variables above.
* Under resources, click `/`, then click `Actions => Create Method`. Select `Any`.
76
+
* Click the `Any label`, choose Integration type `lambda`, check the `Use Lambda Proxy integration` checkbox, and finally select your lambda function's region and name.
77
+
* Create proxy resource:
78
+
* Under resources, click `/`, then click `Actions => Create Resource`. Select `Any`.
79
+
* Select `Configure as proxy resource`, and select `Enable API Gateway CORS`.
80
+
* Select Integration type `Lambda Function Proxy`, and finally select your lambda function's region and name.
81
+
* Under resources, click `Actions => Deploy API`. Select a new stage and give it the name `fastboot`. Hit `Deploy`. You will now see the `Invoke URL`. This is where you site will be hosted.
61
82
62
83
* Ember Application
63
-
* The `rootURL` must match the stage name you selected when creating the api gateway. Otherwise the `link-to` helper wont work.
64
-
```
65
-
// config/environment.js
66
-
var ENV = {
67
-
rootURL: '/fastboot/'
84
+
* The `rootURL` must match the stage name you selected when creating the api gateway. Otherwise the `link-to` helper wont work.
0 commit comments