cd ai-paint
npm i
npm run devImportant
Edit the following file: src\lib\config.ts
Add Environment variables.
Workers & Pages > ai-paint > Settings > Environment variables
AI_GATEWAY_ENDPOINT = ...
WORKERS_AI_API_TOKEN = ... // secret
TURNSTILE_SECRET = ... // secret
Get API Endpoint
AI Gateway > AI Paint API Endpoint > Select Workers AI
Set Caching and Rate-limiting
AI Gateway
Creat API Token
Select template Workers AI
Use the Access policy to restrict access to development previews.
Workers & Pages > ai-paint > Manage > Access policy > Enable access policy
Redirect access to ai-paint.pages.dev using Bulk Redirects.
Bulk Redirects > ...