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
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
1
# adapter-lambda for SvelteKit
2
2
3
3
An adapter to build a [SvelteKit](https://kit.svelte.dev/) app into a lambda ready for deployment with lambda proxy.
4
+
5
+
## Installation
4
6
```
5
7
npm install --save-dev @yarbsemaj/adapter-lambda
6
8
```
7
-
8
9
## Usage
9
10
10
11
In your `svelte.config.cjs` configure the adapter as bellow;
@@ -24,5 +25,11 @@ const config = {
24
25
25
26
};
26
27
```
27
-
## A note on static assets
28
-
Precompiled pages, client and static resources should be served independently of your dynamic content. One solution to this could be to upload the `build/assets/` directory to S3 and using its static site hosting functionality. Then, by using a CDN like CloudFront, requests could be routed to the correct origin.
28
+
Copy `serverless.yml` from the root of this repo to the root of your project
29
+
30
+
After building your app run `sls deploy` to deploy code to AWS.
31
+
32
+
Your app can then be accessed via the CloudFront distribution created as aprt of the stack.
33
+
34
+
## Static Assets and precompiled pages
35
+
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 is used to redirect traffic to the S3 Bucket.
0 commit comments