hono-bun-send-only (Example)
한국어 번역본이 없어 영문 예제 문서를 표시합니다.
Bun + Hono send template with:
- advanced send route (
POST /send) using rawSendInputJSON (single or batch) - SMS shortcut route (
POST /send/sms) - provider: IWINV
Setup
섹션 제목: “Setup”cd examples/hono-bun-send-onlybun installcp .env.example .envFill .env:
IWINV_API_KEY=...IWINV_SMS_API_KEY=...IWINV_SMS_AUTH_KEY=...IWINV_SMS_SENDER_NUMBER=01000000000PORT=3001Run
섹션 제목: “Run”set -a; source .env; set +abun run devRoutes
섹션 제목: “Routes”POST /send(advanced single/batch)POST /send/sms
For batch requests to POST /send, the route always returns 200.
Check per-item success/failure in data.results.
Sample requests
섹션 제목: “Sample requests”Advanced send (single):
curl -X POST http://127.0.0.1:3001/send \ -H "content-type: application/json" \ -d '{ "type":"SMS", "to":"01012345678", "text":"hello from bun advanced route", "from":"01000000000", "providerId":"iwinv" }'Advanced send (batch):
curl -X POST http://127.0.0.1:3001/send \ -H "content-type: application/json" \ -d '[ { "type":"SMS", "to":"01012345678", "text":"hello from bun advanced route #1", "from":"01000000000", "providerId":"iwinv" }, { "type":"SMS", "to":"01012345679", "text":"hello from bun advanced route #2", "from":"01000000000", "providerId":"iwinv" } ]'SMS shortcut send:
curl -X POST http://127.0.0.1:3001/send/sms \ -H "content-type: application/json" \ -d '{ "to":"01012345678", "text":"hello from bun", "from":"01000000000" }'