# Configure build and start for Axum

## Summary
Build and start for an Axum app on Ample. Verified on Axum: the app built and started with the documented commands and answered on its public HTTPS URL. Build and start: `cargo build --release` in the rust builder image (stable toolchain, Cargo.lock committed, pure-Rust dependencies), then the release binary on the ubuntu-24.04 template reading `PORT` and `DATABASE_URL`.

## Prerequisites
- A Axum project (cargo build --release in the rust builder image (stable toolchain, Cargo.lock committed, pure-Rust dependencies), then the release binary on the ubuntu-24.04 template reading `PORT` and `DATABASE_URL`)
- An Ample account token with `servers:write`

## Resource Requirements
- **Primitive**: Compute

## Workflow Steps
1. **Build and start**  
   `cargo build --release` in the rust builder image (stable toolchain, Cargo.lock committed, pure-Rust dependencies), then the release binary on the ubuntu-24.04 template reading `PORT` and `DATABASE_URL`; the server must bind `0.0.0.0` on PORT.
2. **Deploy**  
   Run the synchronous deploy once and read the result.  
   Command: `ample deploy . --name  --public`
3. **Verify**  
   Fetch the live URL on the example; on failure read the build and runtime logs.  
   Command: `ample logs  --kind build`

## Examples
- **Axum pattern fixture**  
  Verified build and start on Axum.  
  Source Ref: `tests/deploy-canaries/axum-patterns`

## Success Checks
- App responds on its public URL.  
  Type: `http_get`  
  Path: `/`  
  Expect: `ample canary axum patterns`

## Limitations
- Verified on the ubuntu-24.04 template at `s-1vcpu-2gb`; other sizes and Axum major versions are not verified.
- Region, compliance attestations and request-duration limits are unknown and not claimed.

## Cost Estimate
- **Currency**: USD  
- **Monthly Amount**: 5.0  
- **Basis**: Size prices from pricing.toml (loaded by the API) at build revision `1ac5595375130d45290090e82ed0f554ccd45405-dirty`  
- **Components**:  
  - Name: app server  
    Size: `s-1vcpu-1gb`  
    Quantity: 1.0  
    Monthly Amount: 5.0
- **Note**: Always-on monthly price of the tested sizes; apps auto-pause when idle. Buckets are allocation-priced per quota and not included.

## Evidence Summary
- Kind: `canary_run`  
  Summary: Axum pattern fixture deployed on Ample (cargo build --release in the rust builder image (stable toolchain, Cargo.lock committed, pure-Rust dependencies), then the release binary on the ubuntu-24.04 template reading `PORT` and `DATABASE_URL`); for this guide: the app built and started with the documented commands and answered on its public HTTPS URL.  
  **Observed At**: `2026-09-21T02:46:37Z`  
  **Implementation Revision**: `1d28ae0-dirty (CLI 0.1.21)`  
  **Expires At**: `2027-03-20T02:46:37Z`  
  **Scope**:  
  - Template: `ubuntu-24.04`

## Next Actions
1. **Browse the catalog index**  
   Method: `GET`  
   Relative Path: `/v1/catalog`
2. **Search published recipes by intent, stack and constraints**  
   Method: `POST`  
   Relative Path: `/v1/catalog/search`  
   Body: {"limit":5,"query":"Configure build and start for Axum"}
3. **Prepare a side-effect-free deployment plan for an authorized project**  
   Method: `POST`  
   Relative Path: `/v1/catalog/plan`
4. **Read the existing agent authentication setup**  
   Method: `GET`  
   Relative Path: `/mcp/setup`
5. **Browse Axum**  
   Method: `GET`  
   Relative Path: `/v1/catalog/nodes/stack%3Aframework-axum`
6. **Browse Configure deployment**  
   Method: `GET`  
   Relative Path: `/v1/catalog/nodes/intent%3Aconfigure-deployment`
7. **Browse Public web service**  
   Method: `GET`  
   Relative Path: `/v1/catalog/nodes/pattern%3Apublic-web-service`
