Code Monkey home page Code Monkey logo

sveltekit-adapter-lambda's Introduction

adapter-lambda for SvelteKit

An adapter to build a SvelteKit app into a lambda ready for deployment with lambda proxy via the Serverless framework.

Installation

npm install --save-dev @yarbsemaj/adapter-lambda

Usage

In your svelte.config.js configure the adapter as bellow;

import preprocess from 'svelte-preprocess'; //Optional
import serverless from '@yarbsemaj/adapter-lambda';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  preprocess: preprocess(), //Optional

  kit: {
    adapter: serverless(),
  },

};

export default config;

Copy serverless.yml from the root of this repo to the root of your project, make sure to change the service name.

After building your app run sls deploy to deploy code to AWS using the build tool serverless.

Your app can then be accessed via the CloudFront distribution created as a part of the stack.

Static Assets and precompiled pages

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.

Infrastructure Diagram

Infra

Help! I'm getting an error while building or serving my app.

Please raise an issue on Github, and I will be happy to issue a fix.

Versions

Adapter Version Sveltekit Version
1.x.x 1.0.0 (Official)
0.12.x 1.0.0-next.433
0.11.x 1.0.0-next.401
0.10.x 1.0.0-next.380
0.9.x 1.0.0-next.348
0.6.x - 0.8.x 1.0.0-next.301
0.5.x 1.0.0-next.286
0.3.x - 0.4.x 1.0.0-next.286
0.2.x 1.0.0-next.239
0.1.x 1.0.0-next.169

sveltekit-adapter-lambda's People

Contributors

yarbsemaj avatar blindestman avatar nboehret avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.