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
Copy file name to clipboardExpand all lines: README.md
+15-5
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
# adapter-lambda for SvelteKit
2
2
3
-
An adapter to build a [SvelteKit](https://kit.svelte.dev/) app into a lambda ready for deployment with lambda proxy via the Serverless framework.
3
+
An adapter to build a [SvelteKit](https://kit.svelte.dev/) app into a lambda ready for deployment with lambda proxy via the Serverless framework or CDK.
4
4
5
5
## Installation
6
6
```
7
7
npm install --save-dev @yarbsemaj/adapter-lambda
8
8
```
9
9
## Usage
10
10
11
-
In your `svelte.config.js` configure the adapter as bellow;
11
+
In your `svelte.config.js` configure the adapter as below;
Copy `serverless.yml` from the root of this repo to the root of your project, make sure to change the service name.
30
32
31
33
After building your app run `sls deploy` to deploy code to AWS using the build tool [serverless](https://www.serverless.com/).
32
34
33
-
Your app can then be accessed via the CloudFront distribution created as a part of the stack.
35
+
### For CDK
36
+
Copy `SvelteKitSite.ts` from the root of this repo into your project and add it to a CDK stack.
37
+
38
+
Deploy your stack using `cdk deploy --all`
39
+
40
+
An example project using cdk can be found [here](https://github.com/yarbsemaj/sveltekit-cdk-starter).
41
+
42
+
### Tada 🎉
43
+
No matter how you deploy, your app can then be accessed via the CloudFront distribution created as a part of the stack.
34
44
35
45
## Static Assets and precompiled pages
36
-
To server static assets and precompiled pages this adapter makes use of S3. In order to route traffic the correct destination a Lambda@edge fuction is used to perfrom a origin rewrite to redirect traffic to the S3 Bucket.
46
+
To server static assets and precompiled pages, this adapter makes use of S3. In order to route traffic to the correct destination a Lambda@edge function is used to perform an origin rewrite to redirect traffic to the S3 Bucket.
0 commit comments