> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/honojs/hono/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Get started with Hono in minutes

Get your first Hono application up and running in minutes. Hono is an ultrafast web framework built on Web Standards that works on any JavaScript runtime.

## Create a New Project

The fastest way to get started is using the `create-hono` scaffolding tool:

<Steps>
  <Step title="Create your project">
    Run the scaffolding command to create a new Hono project:

    <CodeGroup>
      ```bash npm theme={null}
      npm create hono@latest
      ```

      ```bash yarn theme={null}
      yarn create hono
      ```

      ```bash pnpm theme={null}
      pnpm create hono
      ```

      ```bash bun theme={null}
      bun create hono
      ```
    </CodeGroup>

    You'll be prompted to:

    * Enter a project name
    * Choose a template (cloudflare-workers, deno, bun, nodejs, etc.)
    * Select whether to install dependencies
  </Step>

  <Step title="Navigate to your project">
    ```bash theme={null}
    cd my-app
    ```
  </Step>

  <Step title="Start the development server">
    The start command depends on your chosen runtime:

    <CodeGroup>
      ```bash Cloudflare Workers theme={null}
      npm run dev
      ```

      ```bash Bun theme={null}
      bun run dev
      ```

      ```bash Deno theme={null}
      deno task start
      ```

      ```bash Node.js theme={null}
      npm run dev
      ```
    </CodeGroup>
  </Step>

  <Step title="Open your browser">
    Navigate to `http://localhost:8787` (or the port shown in your terminal) to see your app running.
  </Step>
</Steps>

## Your First Hono App

Here's a simple "Hello World" example that demonstrates the core concepts:

```typescript index.ts theme={null}
import { Hono } from 'hono'

const app = new Hono()

app.get('/', (c) => c.text('Hono!'))

export default app
```

This minimal example shows:

* **Import**: Bring in the `Hono` class from the `hono` package
* **Create**: Instantiate a new Hono application
* **Route**: Define a GET route at the root path
* **Handler**: Return a text response using the context object `c`
* **Export**: Make the app available to the runtime

## Add More Routes

Expand your app with different HTTP methods and dynamic routes:

```typescript theme={null}
import { Hono } from 'hono'

const app = new Hono()

// Simple GET route
app.get('/', (c) => c.text('Hono!'))

// Dynamic route with parameters
app.get('/hello/:name', (c) => {
  const name = c.req.param('name')
  return c.text(`Hello, ${name}!`)
})

// POST route with JSON response
app.post('/api/users', (c) => {
  return c.json({ message: 'User created' }, 201)
})

// Wildcard route
app.get('/posts/*', (c) => {
  return c.text('Blog posts')
})

export default app
```

## Working with Different Runtimes

One of Hono's superpowers is that the same code runs on multiple platforms. Here's how to run your app on different runtimes:

<Tabs>
  <Tab title="Cloudflare Workers">
    ```typescript theme={null}
    import { Hono } from 'hono'

    const app = new Hono()
    app.get('/', (c) => c.text('Hono!'))

    export default app
    ```

    Run with:

    ```bash theme={null}
    npm run dev
    ```
  </Tab>

  <Tab title="Bun">
    ```typescript theme={null}
    import { Hono } from 'hono'

    const app = new Hono()
    app.get('/', (c) => c.text('Hono!'))

    export default app
    ```

    Run with:

    ```bash theme={null}
    bun run dev
    ```
  </Tab>

  <Tab title="Deno">
    ```typescript theme={null}
    import { Hono } from 'hono'

    const app = new Hono()
    app.get('/', (c) => c.text('Hono!'))

    Deno.serve(app.fetch)
    ```

    Run with:

    ```bash theme={null}
    deno run --allow-net app.ts
    ```
  </Tab>

  <Tab title="Node.js">
    ```typescript theme={null}
    import { Hono } from 'hono'
    import { serve } from '@hono/node-server'

    const app = new Hono()
    app.get('/', (c) => c.text('Hono!'))

    serve(app)
    ```

    Run with:

    ```bash theme={null}
    node app.js
    ```

    <Note>
      For Node.js, you'll need to install `@hono/node-server` separately:

      ```bash theme={null}
      npm install @hono/node-server
      ```
    </Note>
  </Tab>
</Tabs>

## Response Types

Hono's context object provides convenient methods for different response types:

```typescript theme={null}
import { Hono } from 'hono'

const app = new Hono()

// Text response
app.get('/text', (c) => c.text('Hello!'))

// JSON response
app.get('/json', (c) => c.json({ message: 'Hello!' }))

// HTML response
app.get('/html', (c) => c.html('<h1>Hello!</h1>'))

// Custom response
app.get('/custom', (c) => {
  return new Response('Custom', {
    status: 200,
    headers: { 'X-Custom': 'Header' }
  })
})

export default app
```

## Next Steps

Now that you have a basic Hono app running, explore more features:

<CardGroup cols={2}>
  <Card title="Routing" icon="route" href="/routing">
    Learn about path parameters, wildcards, and route grouping
  </Card>

  <Card title="Middleware" icon="shield" href="/middleware">
    Add authentication, CORS, logging, and more
  </Card>

  <Card title="Context" icon="cube" href="/concepts/context">
    Master the request and response handling
  </Card>

  <Card title="Validation" icon="check" href="/concepts/validation">
    Validate request data with type safety
  </Card>
</CardGroup>
