import { Callout } from '@theguild/components'

# Deploying Hive Gateway to Cloudflare Workers

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

[Cloudflare Workers](https://developers.cloudflare.com/workers) provides a serverless execution
environment that allows you to create entirely new applications or augment existing ones without
configuring or maintaining infrastructure.

<Callout>
  Before you start, make sure you read the [Serverless / On the
  Edge](/docs/gateway/deployment/serverless) page.
</Callout>

See [Bundling Problems](/docs/gateway/deployment/serverless#bundling-problem) for more details about
how to load the supergraph and `transports` option.

```ts filename="index.js"
import { createGatewayRuntime } from '@graphql-hive/gateway'
import http from '@graphql-mesh/transport-http'
import supergraph from './supergraph'

export const gateway = createGatewayRuntime({
  // All options available in `gateway.config.ts` configuration can also be passed here.
  supergraph,
  transports: {
    http // For example, http transport is required for subgraphs using standard GraphQL over HTTP.
  }
})

export default { fetch: gateway }
```

```js filename="supergraph.js"
export default /* GraphQL */ `
  PLACE YOUR SUPERGRAPH SDL HERE
`
```

<Callout>
  If you want to use [Cloudflare KV
  Cache](https://developers.cloudflare.com/workers/runtime-apis/kv) as a distributed cache, [see
  here for Hive Gateway integration](/docs/gateway/other-features/performance#cloudflare-workers-kv)
</Callout>
