## Deliver public assets through CDN for Nuxt

### Summary
Cdn assets for a Nuxt app on Ample. Verified on Nuxt: a versioned, immutable-cached asset uploaded to a published bucket and served from the CDN URL. Build and start: `nuxt build` then `node .output/server/index.mjs` (reads HOST and PORT) on the node-22 template.

### Representative Queries
- Deliver public assets through CDN for Nuxt
- Where can I host Deliver public assets through CDN built with Nuxt?
- I need a public-origin configuration, versioned asset build and observable cache behavior.

### Prerequisites
- A Nuxt project (`nuxt build` then `node .output/server/index.mjs` (reads HOST and PORT) on the node-22 template)
- A bucket from `ample bucket create` with credentials passed as encrypted S3_* environment variables
- An Ample account token with `servers:write`, `buckets:read`

### Workflow Steps
1. **Build and start**  
   `nuxt build` then `node .output/server/index.mjs` (reads HOST and PORT) on the node-22 template; the server must bind `0.0.0.0` on PORT.
2. **Publish a bucket for public assets**  
   Publish only the asset bucket; upload versioned keys with an immutable Cache-Control header and build URLs from its public URL.  
   Command: `ample bucket publish `
3. **Verify**  
   Fetch the live URL and `/api/p/versioned-static-assets` on the example; on failure read the build and runtime logs.  
   Command: `ample logs  --kind build`

### Limitations
- Verified on the node-22 template at size `s-1vcpu-1gb`; other sizes and Nuxt major versions are not verified.
- Region, compliance attestations and request-duration limits are unknown and not claimed.
- The CDN serves published-bucket objects only; cache rules, purge, and TTL control are not verified.

### Cost Estimate
- **Currency**: USD  
- **Monthly Amount**: $5.00  
- **Basis**: size prices from pricing.toml  
- **Components**:  
  - **App Server**: size `s-1vcpu-1gb`, Quantity: 1.0, Monthly Amount: $5.00
  - **Note**: Always-on monthly price of the tested sizes; apps auto-pause when idle. Buckets are allocation-priced per quota and not included.

### Success Checks
- App responds on its public URL:  
   - Kind: `http_get`, Path: `/`, Expect: `ample canary nuxt patterns`
- Versioned-static-assets check from the example:  
   - Kind: `http_get`, Path: `/api/p/versioned-static-assets`, Expect: `see the pattern fixture checks`

### Evidence Summary
- **Kind**: canary_run  
  **Summary**: Nuxt pattern fixture deployed on Ample (verified on date).  
  **Observed At**: 2026-09-20T03:31:44Z  
  **Expires At**: 2027-03-19T03:31:44Z  
  **Checks**: `/api/p/versioned-static-assets`

### Tested Configuration
**Template**: node-22  
**Runtime**: node  
**Size**: s-1vcpu-1gb  
**Install**: `npm install`  
**Build**: `npm run build --if-present`  
**Start**: `npm run start`

### Input Schema
- **Env**: Encrypted environment variables
- **Name**: App name
- **Path**: Project directory or ample.toml service
- **Release Command**: Migration command run before activation

**Required**: env, name, path
