Skip to content

Hello Bun

A minimal Hono web application running on Bun. TypeScript without a compilation step. One container, one service, no database, no cache.

Overview

Repository git@gitlab.com:appmecca-sample-apps/hello-bun.git
Tech Stack Bun 1.x / Hono / TypeScript
Services web (port 3000)
Database None
Cache None
URL Pattern https://hello-bun-web.{env}.appmecca.net

What This App Demonstrates

  • Deploying a Bun/TypeScript application on AppMecca
  • Native TypeScript execution (no compilation step)
  • Lightweight container with fast startup
  • Health check endpoint pattern

appmecca.yaml

containers:
  - name: hello-bun
    dockerfile: Dockerfile
    context: .

deploy:
  - name: web
    container: hello-bun
    port: 3000
    health_check:
      path: /health

The configuration is identical in structure to any other single-container app. Hono on Bun listens on port 3000.

Step-by-Step Deployment

1. Register the app

mecca register git@gitlab.com:appmecca-sample-apps/hello-bun.git -e dev

2. Build the container

mecca build trigger -e dev -g git@gitlab.com:appmecca-sample-apps/hello-bun.git
Expected output
Build started: build-xxxxxxxx
Cloning repository...
Building container: hello-bun
Pushing image to the private registry: hello-bun/web
Build complete. Duration: 20s

Bun builds are fast because there is no compilation step -- Bun runs TypeScript natively.

3. Deploy

mecca app deploy -e dev hello-bun
Expected output
Deploying hello-bun to dev...
Deployment queued: deploy-xxxxxxxx
Waiting for agents...
Container started: hello-bun-web
Health check passed: /health -> 200 OK
Deployment complete.

Services:
  web: https://hello-bun-web.dev.appmecca.net

4. Verify

mecca app show hello-bun -e dev

Test the endpoint:

curl https://hello-bun-web.dev.appmecca.net/health
{"status": "healthy"}

Key Concepts

Bun runtime

Bun is an all-in-one JavaScript/TypeScript runtime that natively executes TypeScript files without a separate compilation step. It includes a package manager, bundler, and test runner. Container images based on oven/bun are small and start quickly.

Hono framework

Hono is a small, fast web framework designed for edge runtimes and modern JavaScript runtimes like Bun, Deno, and Cloudflare Workers. It provides Express-like routing with excellent TypeScript support and minimal overhead.

Any language, same workflow

AppMecca does not care what language your application is written in. As long as your container listens on the declared port and responds to health checks, the deployment workflow is identical.

What's Next?