---
description:
  Hive Gateway provides you a cross-platform GraphQL Server. So you can easily integrate it into any
  platform besides Node.js.
---

import { Callout } from '@theguild/components'

# Integration with Bun

Hive Gateway provides you a cross-platform GraphQL Server. So you can easily integrate it into any
platform besides Node.js. [Bun](https://bun.sh) is a modern JavaScript runtime like Node or Deno,
and it supports Fetch API as a first class citizen. So the configuration is really simple like any
other JS runtime with Hive Gateway;

## Hive Gateway CLI

You can follow the introduction page directly to [use Hive Gateway CLI](/docs/gateway#installation).

Since Bun has the compatibility layer for Node.js, all Node specific features are available in Bun.

## Hive Gateway Runtime

Use this method only if you know what you are doing. It is recommended to use Hive Gateway CLI for
most cases.

```ts
import { createGatewayRuntime } from '@graphql-hive/gateway-runtime'

const gatewayRuntime = createGatewayRuntime(/* Your configuration */)

const server = Bun.serve({
  fetch: gatewayRuntime
})

console.info(
  `Server is running on ${new URL(
    server.graphqlEndpoint,
    `http://${server.hostname}:${server.port}`
  )}`
)
```
