# Deployment

## Local API Server

```bash
bun run server
```

Use a custom port with:

```bash
PORT=3001 bun run server
```

The server reads `data/generated/emojis.json` and exposes the same routes as the hosted API.

## Cloudflare Workers

Emojistry ships a Cloudflare Worker entrypoint for the hosted REST API. It bundles the generated emoji snapshot at deploy time, so GitHub and npm remain the source of truth for the data.

Run the Worker locally:

```bash
bun run worker:dev
```

Deploy with Wrangler:

```bash
bun run worker:deploy
```

Production API domain:

```text
https://api.emojistry.kfiros.com
```

Useful smoke tests:

```bash
curl https://api.emojistry.kfiros.com/health
curl https://api.emojistry.kfiros.com/health/badge
curl https://api.emojistry.kfiros.com/v1
curl "https://api.emojistry.kfiros.com/v1/search?q=heart&limit=1"
```
