How Amplify Gen 3 hosting works and how to verify it: adapters, route evaluation order, and the emulator
The new AWS Amplify (Amplify Gen 3) was introduced around AWS re:Invent 2026.
According to an article published on About Amazon, Amazon's official news site, on November 30, 2026 (US time), it brings app hosting, a database, and sign-in together in one place, and it is designed with use from coding agents in mind.
There are already articles that lay out the big picture of Gen 3 with diagrams and walk through deploying from the console and the CLI (both in Japanese).
https://qiita.com/Nana_777/items/2086674f35546f313153 https://dev.classmethod.jp/articles/aws-amplify-gen3-getting-started/
This article goes one step further and looks at how an app built with Next.js or SvelteKit is actually served by Amplify hosting. Starting from the adapter that converts the build output, it covers the generated .amplify/ folder and its route definitions, the differences from the previous Amplify Hosting, the emulator for checking the output locally, --prebuilt for deploying a local build to AWS, and cleaning up the app afterwards.
For the explanation, I use a minimal SvelteKit app I built to investigate a bug in the Gen 3 SvelteKit adapter. How I found and fixed that bug will be covered in a separate article.
This article is based on my work log from December 1 to 3, 2026, and on the repository READMEs and official documentation as of that time. Gen 3 was just announced, so details may change.
Adapters for each framework and what they do
The source code for the Gen 3 adapters and client SDK is public on GitHub.
An adapter converts a framework's build output into a common shape that Amplify hosting can read. The official documentation describes the same role: the adapter turns the build output into a deployment, Amplify serves static files and pre-rendered pages from the edge, and routes rendered on the server run on compute.
According to the same documentation, an adapter is needed when there is code that runs on a server, such as SSR. If the output is fully static, you can deploy without one. This article covers adapter output that includes SSR.
The adapters for each framework are listed below. Supported versions come from the official AWS documentation, and usage comes from the README of the adapter packages (checked on December 3, 2026).
https://docs.aws.amazon.com/amplify/latest/userguide/ssr-supported-features.html https://github.com/aws-amplifygen3/amplifygen3/blob/main/packages/adapters/js/README.md
- Framework: Next.js 15.5.15 or later (16.2 or later recommended) / Package:
@aws-amplifygen3/adapter-nextjs/ Usage:npx @aws-amplifygen3/adapter-nextjs build(16.2 or later can also useadapterPath) - Framework: Astro 5 or later / Package:
@aws-amplifygen3/adapter-astro/ Usage:adapter: amplify()inastro.config.mjs - Framework: Nuxt 4 (Nitro) / Package:
@aws-amplifygen3/adapter-nuxt/ Usage:nitro.presetinnuxt.config.ts - Framework: SvelteKit 2 and 3 / Package:
@aws-amplifygen3/adapter-sveltekit/ Usage: SvelteKit 3:sveltekit({ adapter })invite.config.js; SvelteKit 2:kit.adapterinsvelte.config.js
The README also lists @aws-amplifygen3/adapter-nodejs, for apps that run as a Node.js HTTP server regardless of framework. It is used with npx @aws-amplifygen3/adapter-nodejs build. It is not in the supported versions table of the official documentation.
Whatever the framework, every adapter outputs a .amplify/ folder with the same structure. So the way to read deployment-manifest.json that I explain here with a SvelteKit app applies as is to apps built with Next.js, Nuxt, and the others.
The structure of the .amplify/ folder
For an app that includes SSR, the adapter output looks like this.
.amplify/
├── deployment-manifest.json # routes, compute definitions, location of static files, and more
├── static/ # files served as they are
└── compute/<name>/ # code that runs on the server (index.js is the entry point)
static/ holds the HTML, JavaScript, and CSS generated at build time. compute/ holds the code that handles each request on the server, as with SSR.
Which of static/ and compute/ answers a given request is decided by deployment-manifest.json. According to the README, this file is validated against a schema at build time.
Routes are covered in the next section, so here I look at the rest of deployment-manifest.json. For the SvelteKit test app, it came out like this.
{
"version": 1,
"compute": {
"default": {
"runtime": "NodeJs-24.x",
"directory": "compute/default",
"entrypoint": "index.js"
}
},
"staticAssets": "static"
}
compute lists, for each server process name (here, default), the runtime (runtime), the folder holding the code (directory), and the entry file (entrypoint). staticAssets is the name of the folder holding the static files.
Reading the routes in deployment-manifest.json, and their evaluation order
Routes form an array, and each one has a regular expression (source) that is matched against the request path. You specify how to respond on a match with target, and what to do instead when target cannot respond with fallback.
The SvelteKit test app has a top page, a pre-rendered page (/cases/normal), and a page rendered with SSR (/live). Here are the routes the adapter produced.
[
{
"source": "^/_app/.*$",
"target": {
"kind": "static",
"cacheControl": "public, max-age=31536000, immutable"
},
"fallback": {
"kind": "static"
}
},
{
"source": "^/$",
"target": {
"kind": "rewrite",
"targetUri": "/index.html",
"cacheControl": "public, max-age=3600"
},
"fallback": {
"kind": "compute",
"computeName": "default"
}
},
{
"source": "^/cases/normal$",
"target": {
"kind": "rewrite",
"targetUri": "/cases/normal.html",
"cacheControl": "public, max-age=3600"
},
"fallback": {
"kind": "compute",
"computeName": "default"
}
},
{
"source": "^/.*$",
"target": {
"kind": "compute",
"computeName": "default"
},
"fallback": {
"kind": "static"
}
}
]
Reading from the top, the first route returns the JavaScript and CSS under /_app/ straight from static/. The second and third return pre-rendered HTML (/index.html and /cases/normal.html) for requests to / and /cases/normal. The last one, ^/.*$, matches every path and passes anything that did not match above to compute.
These three ways of responding are set by the kind in target.
kind:static/ How it responds: Returns the file instatic/at the same path / How the SvelteKit test app uses it: Returns JavaScript and CSS under/_app/kind:rewrite/ How it responds: Keeps the URL and returns the file attargetUri/ How the SvelteKit test app uses it: Returns pre-rendered HTML for/and/cases/normalkind:compute/ How it responds: Hands the request to the server process incompute// How the SvelteKit test app uses it: Handles SSR pages like/live, and any request that matches no other route
rewrite swaps only the content without changing the URL the user sees. A request to /cases/normal gets /cases/normal.html, generated at build time.
In the emulator's implementation, described later, if that pre-rendered file is missing, the request is handed to the compute in fallback with the original request URL. I did not check what happens on AWS when the pre-rendered file is missing.
As in the excerpt, delivery routes of kind static, rewrite, and compute without conditions are evaluated from the top, and the first matching route decides how to respond. An SSR page like /live has no dedicated route and reaches the SvelteKit server through the final ^/.*$ route. Paths that do not exist also go to compute, and the SvelteKit server returns the 404.
When you read routes, this evaluation order matters most. If a broad regular expression sits near the top, requests are decided there and never reach the more specific routes below. That means if an adapter gets the order or a regular expression wrong, users get a different page even when the app code is correct.
You can confirm this evaluation order in the emulator source. On AWS as well, when I requested a URL that matched several routes, the page from the earlier route came back, a result consistent with the same order. The bug that involved this URL will be covered in a separate article.
That said, matching a route does not always end the processing. In the emulator's implementation, there are two exceptions that continue to the routes below.
One is a route with kind: "headers", which only adds headers to the response; what to return is decided by the routes below. The other is a route with a condition (condition): if the request does not meet the condition and there is no fallback, the route is skipped.
The output for this SvelteKit test app contains neither. If you see such routes when reading another app's manifest, do not stop at the first match; keep reading the routes below it.
Not every JavaScript RegExp feature can be used in source. According to the README of the deployment manifest package, hosting evaluates these regular expressions with a Rust engine called fancy-regex. Adapters also check at build time that the regular expressions they output pass this engine.
How this differs from the previous Amplify Hosting deployment specification
Amplify Hosting, which served SSR apps up through Gen 2, has a deployment specification built on the same idea: put the build output into static and compute folders plus a manifest. If you have used Amplify Hosting, much of this may look familiar. However, the folder and file names and the way routes are written have changed.
https://docs.aws.amazon.com/amplify/latest/userguide/ssr-deployment-specification.html
- Previous Amplify Hosting / Amplify Gen 3
- Output folder:
.amplify-hosting//.amplify/ - Manifest:
deploy-manifest.json/deployment-manifest.json - How routes match: A pattern like
/_nuxt/builds/*inpath/ A regular expression insource - Kinds of response:
Static,Compute,ImageOptimization/static,rewrite,compute,headers, and more - Evaluation order: The official documentation says routes are checked from the top and the first match is used / Not found in the official documentation; judged from the emulator implementation and results on AWS
fallback: The official documentation says it is used when the original response returns 404 / In the emulator implementation, used when the pre-rendered file is missing
The biggest difference is that routes are now regular expressions. In the previous path, the only wildcard was *, and characters like parentheses could not be written in a path. In Gen 3's source, parentheses and asterisks are treated as regular expression syntax.
Adapters must correctly escape the characters in URLs when building routes, and getting this wrong makes a route match unintended URLs. The SvelteKit adapter bug I will cover in a separate article came out of exactly this difference.
The evaluation order and fallback behavior are documented for the previous specification, but for Gen 3, what I have written is only what I could confirm. Do not read the previous specification as if it were the Gen 3 specification.
Checking the output locally with the emulator
The deployment-manifest package in the Gen 3 repository includes an emulator that reads a .amplify/ folder and reproduces the hosting behavior locally.
Other local stand-ins for AWS include AWS Emulator, released in November 2026, and the local implementation in CDK Blocks (formerly AWS Blocks). Both return responses locally in place of backends such as databases and storage, so that you can run an app. I wrote about how the two relate in another article (in Japanese).
AWS EmulatorはAWS Blocksのモックを置き換えるのか?実際に動かして見えた「三つ目の層」
zenn.dev
The Gen 3 emulator is something different. It only routes incoming requests to files in static/ or to compute according to the manifest routes, and it does not reproduce Gen 3 backends such as the database or authentication. According to the README, it evaluates the manifest routes in order, serves static files, and starts the compute entry point as a child process. It is meant for checking adapter output, not as a production server.
The emulator does not perform image optimization (such as resizing). The README says that a request matching an image optimization route is matched again against the routes listed after it in the manifest. However, the implementation I checked behaves differently: it returns the image as is, without processing it. If the original image cannot be fetched, it moves to that route's fallback, not to the later routes.
To use the emulator, clone the Gen 3 repository, then install dependencies and build packages/adapters/js with Node.js 22 or later. Then start it, pointing it at the .amplify/ folder of the app you want to check.
cd /path/to/amplifygen3/packages/adapters/js
npm ci
npm run build
node packages/deployment-manifest/dist/cjs/emulator/hosting-emulator.js \
--output-dir /path/to/app/.amplify --port 8085
In practice, I found two things worth watching out for. The first is requests right after startup. The logs showed that the SvelteKit server for compute finished starting after the emulator was already accepting requests (after it printed "listening"). When I started sending requests as soon as the static top page responded, requests routed to compute sometimes returned 502.
I have not pinned down the cause, but the emulator's design suggests one. The emulator serves static files itself and forwards only requests for compute to the SvelteKit server it started as a child process. Static pages like the top page can be served right after startup, but until the SvelteKit server finishes starting, there is likely nowhere to forward compute requests.
Indeed, once I waited until a page served by compute, such as /live, responded before sending requests, the 502s went away. It is better not to judge the e


Comments
No comments yet. Start the discussion.