Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
astro-sst
Advanced tools
Readme
This adapter allows Astro to deploy your SSR or static site to AWS.
Add the AWS adapter to enable SST in your Astro project with the following astro add
command. This will install the adapter and make the appropriate changes to your astro.config.mjs
file in one step.
# Using NPM
npx astro add astro-sst
# Using Yarn
yarn astro add astro-sst
# Using PNPM
pnpm astro add astro-sst
If you prefer to install the adapter manually instead, complete the following two steps:
Install the AWS adapter to your project’s dependencies using your preferred package manager. If you’re using npm or aren’t sure, run this in the terminal:
npm install astro-sst
Add two new lines to your astro.config.mjs
project configuration file.
import { defineConfig } from "astro/config";
import aws from "astro-sst";
export default defineConfig({
output: "server",
adapter: aws(),
});
You can utilize different deployment depending on your needs:
regional
: SSR inside a Lambda function with CloudFront cached assets. (default)edge
: SSR inside a Lambda@Edge function with CloudFront cached assets.static
: SSG assets deployed to S3 with CloudFront cached assets.You can change where to target by changing the import:
import { defineConfig } from "astro/config";
import aws from "astro-sst";
export default defineConfig({
output: "server",
adapter: aws({
deploymentStrategy: "edge",
}),
});
When utilizing regional
deployment strategy, you can choose how responses are handled:
buffer
: Responses are buffered and sent as a single response. (default)stream
: Responses are streamed as they are generated.import { defineConfig } from "astro/config";
import aws from "astro-sst";
export default defineConfig({
output: "server",
adapter: aws({
deploymentStrategy: "regional",
responseMode: "stream",
}),
});
When utilizing regional
deployment strategy, server routes should be defined for any routes utilizing non-GET
methods:
import { defineConfig } from "astro/config";
import aws from "astro-sst";
export default defineConfig({
output: "server",
adapter: aws({
deploymentStrategy: "regional",
serverRoutes: [
"feedback", // Feedback page which requires POST method
"login", // Login page which requires POST method
"user/*", // Directory of user routes which are all SSR
"api/*", // Directory of API endpoints which require all methods
],
}),
});
FAQs
Adapter that allows Astro to deploy your site to AWS utilizing SST.
The npm package astro-sst receives a total of 3,309 weekly downloads. As such, astro-sst popularity was classified as popular.
We found that astro-sst demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.