Skip to content
surflow
All posts

How this site runs on AWS

AWS, Next.js, SST

This is a sample post. It's here so the blog has something to show before the CMS is connected — replace it by publishing your first post in Sanity Studio.

The moving parts

  • Next.js App Router, deployed with SST to Lambda behind CloudFront.
  • Blog posts written in Sanity and fetched over its HTTP API.
  • A contact form that calls a Lambda function, which sends email through Amazon SES.

Publishing a post

When a post is published, Sanity calls a webhook on the site. The handler checks a shared secret and expires the posts cache tag, so the next visitor gets the fresh page.

app/api/revalidate/route.ts
revalidateTag("posts", { expire: 0 });