Skip to content

Latest commit

 

History

History

http-server

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

HTTP server

Serve a streaming agent over HTTP with Server-Sent Events.

Level: Advanced · Concept: Streaming · Needs: a model API key (DEEPSEEK_API_KEY as written; any provider works)

flowchart LR
  C([curl]) -- POST /chat --> H[node:http] --> S[StreamingAgent]
  S -. SSE events .-> C
Loading

What it shows

  • Each agent event becomes one data: line.
  • The server uses only node:http; any framework works the same way.

Run

# Once, from the repository root
pnpm install && pnpm build

export DEEPSEEK_API_KEY=sk-...
pnpm --filter @astack-examples/http-server start

The full program is index.ts.