https://github.com/willfarrell/sveltekit-adapter-middy
SvelteKit adapter for AWS Lambda with Middy
https://github.com/willfarrell/sveltekit-adapter-middy
Last synced: 16 days ago
JSON representation
SvelteKit adapter for AWS Lambda with Middy
- Host: GitHub
- URL: https://github.com/willfarrell/sveltekit-adapter-middy
- Owner: willfarrell
- License: mit
- Created: 2024-06-10T02:14:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-18T14:24:32.000Z (12 months ago)
- Last Synced: 2025-05-03T06:06:19.976Z (10 months ago)
- Language: JavaScript
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Creates a lambda that supports a Function URL with streaming responses.
## Features
- Response Stream
- Extendable with Middy middlewares:
- `http-content-encoding`
- `http-security-headers`
- `ssm`/`secrets-manger`
- Removes `x-sveltekit-page` headers
- Multiple `Set-Cookies`
- Override `Origin` header with `ORIGIN` env
Note: Bring your own deployment.
## Getting started
```bash
npm i -D sveltekit-adapter-middy
```
```js
import adapter from 'sveltekit-adapter-middy'
export default {
kit: {
adapter: adapter({
// options
})
}
}
```
### Options
- `handlerPath` (string): Relative path to handler override file. Overriding allows you to add in Content-Encoding, Security Headers, and pass in secrets more securely. Defaults to build-in minimalist handler.
- `out` (string): Relative path to build dir. Defaults to `build`
- `esbuildOptions` (object): `esbuild` option overrides. See [code]() for defaults.
## Recommended Infrastructure
- CloudFront: Route to static assets / pages, with fallback to server side rendering
- S3: store static assets and pages
- Lambda Function URL: server side rendering
## Roadmap
- infra diagram
- cli to sync static assets to S3 w/ headers
- LLRT
## License
Licensed under [MIT License](LICENSE). Copyright (c) 2017-2024 [Luciano Mammino](https://github.com/lmammino), [will Farrell](https://github.com/willfarrell), and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).