Files
dewemoji/phase-2-api.md
2026-02-03 22:06:08 +07:00

44 lines
913 B
Markdown

# Phase 2 API Delivery
## Implemented endpoints (Laravel app)
Base path: `app/` project
- `GET /v1/categories`
- `GET /v1/emojis`
- `POST /v1/license/verify`
- `OPTIONS /v1/{any}` (CORS preflight)
## Compatibility behavior
- `/v1/*` routes are exposed without `/api` prefix (extension-compatible).
- `GET /v1/emojis` accepts both `q` and `query`.
- Responses include `X-Dewemoji-Tier` header.
## Current license mode
Environment-driven stub:
- `DEWEMOJI_LICENSE_ACCEPT_ALL=true` => any key is accepted as Pro.
- `DEWEMOJI_PRO_KEYS=key1,key2` => explicit key whitelist mode.
## Data source
Configured via:
- `DEWEMOJI_DATA_PATH` (defaults to `../../dewemoji-api/data/emojis.json` from `app/`).
## Test coverage
Added feature tests:
- `app/tests/Feature/ApiV1EndpointsTest.php`
- fixture: `app/tests/Fixtures/emojis.fixture.json`
Run:
```bash
cd app
php artisan test --filter=ApiV1EndpointsTest
```