JSPM

  • Created
  • Published
  • Downloads 465
  • Score
    100M100P100Q93500F
  • License MIT

An adapter for deploying an Astro application to AWS Lambda

Package Exports

  • @astro-aws/adapter
  • @astro-aws/adapter/lambda/handlers/edge
  • @astro-aws/adapter/lambda/handlers/edge.js
  • @astro-aws/adapter/lambda/handlers/ssr
  • @astro-aws/adapter/lambda/handlers/ssr-stream
  • @astro-aws/adapter/lambda/handlers/ssr-stream.js
  • @astro-aws/adapter/lambda/handlers/ssr.js
  • @astro-aws/adapter/powertools
  • @astro-aws/adapter/powertools.js

Readme

@astro-aws/adapter

An Astro adapter for building an SSR application and deploying it to AWS Lambda.

Install

# Using NPM
npx astro add @astro-aws/adapter

# Using Yarn
yarn astro add @astro-aws/adapter

# Using PNPM
pnpm astro add @astro-aws/adapter

# Using Bun
bun x astro add @astro-aws/adapter

Manually

  1. Install the package.
# Using NPM
npm install -D @astro-aws/adapter

# Using Yarn
yarn add -D @astro-aws/adapter

# Using PNPM
pnpm add -D @astro-aws/adapter

# Using Bun
bun add -D @astro-aws/adapter
  1. Add the following to your astro.config.mjs file.
import { defineConfig } from "astro/config"
import astroAws from "@astro-aws/adapter"

export default defineConfig({
    output: "server",
    adapter: astroAws(),
})

SSR Usage

  1. Install the package.
# Using NPM
npm install -D @astro-aws/adapter

# Using Yarn
yarn add -D @astro-aws/adapter

# Using PNPM
pnpm add -D @astro-aws/adapter

# Using Bun
bun add -D @astro-aws/adapter
  1. Add the following to your astro.config.mjs file.
import { defineConfig } from "astro/config"
import astroAws from "@astro-aws/adapter"

export default defineConfig({
    output: "server",
    adapter: astroAws({
        mode: "ssr",
    }),
})

SSR Stream Usage

  1. Install the package.
# Using NPM
npm install -D @astro-aws/adapter

# Using Yarn
yarn add -D @astro-aws/adapter

# Using PNPM
pnpm add -D @astro-aws/adapter

# Using Bun
bun add -D @astro-aws/adapter
  1. Add the following to your astro.config.mjs file.
import { defineConfig } from "astro/config"
import astroAws from "@astro-aws/adapter"

export default defineConfig({
    output: "server",
    adapter: astroAws({
        mode: "ssr-stream",
    }),
})

Edge Usage

NOTE: Environment variables are not supported in edge mode. Due to the limitations of AWS Lambda@Edge.

  1. Install the package.
# Using NPM
npm install -D @astro-aws/adapter

# Using Yarn
yarn add -D @astro-aws/adapter

# Using PNPM
pnpm add -D @astro-aws/adapter

# Using Bun
bun add -D @astro-aws/adapter
  1. Add the following to your astro.config.mjs file.
import { defineConfig } from "astro/config"
import astroAws from "@astro-aws/adapter"

export default defineConfig({
    output: "server",
    adapter: astroAws({
        mode: "edge",
    }),
})

Example

See the source code of this site