54 lines
1.1 KiB
Markdown
54 lines
1.1 KiB
Markdown
# Proxy Artifact
|
|
|
|
Standalone TypeScript API proxy packaged as a Replit `kind = "web"` artifact.
|
|
|
|
## Replit
|
|
|
|
The repo includes:
|
|
|
|
- `.replit` for the Run button
|
|
- `.replit-artifact/artifact.toml` for Replit Publish
|
|
|
|
Run command:
|
|
|
|
```bash
|
|
PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} pnpm prod
|
|
```
|
|
|
|
Production publish build:
|
|
|
|
```bash
|
|
pnpm install --ignore-workspace && pnpm build:fast
|
|
```
|
|
|
|
Production publish run:
|
|
|
|
```bash
|
|
PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} NODE_ENV=production node --enable-source-maps dist/index.mjs
|
|
```
|
|
|
|
## Config
|
|
|
|
The app reads Replit AI Integration variables automatically:
|
|
|
|
- `AI_INTEGRATIONS_OPENAI_BASE_URL`
|
|
- `AI_INTEGRATIONS_OPENAI_API_KEY`
|
|
- `AI_INTEGRATIONS_ANTHROPIC_BASE_URL`
|
|
- `AI_INTEGRATIONS_ANTHROPIC_API_KEY`
|
|
|
|
Server/proxy overrides:
|
|
|
|
- `HOST`
|
|
- `PORT`
|
|
- `PROXY_API_KEY`
|
|
|
|
CLI flags still work for manual runs, but mass deployments should use environment variables.
|
|
|
|
## Commands
|
|
|
|
- `pnpm install --ignore-workspace`
|
|
- `pnpm prod`
|
|
- `pnpm run build:fast`
|
|
- `pnpm run build`
|
|
- `pnpm run typecheck`
|