Skip to content

Synternet/api-subagent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Subagent

API Subagent is a subagent to proxy HTTP APIs via Synternet.

sequenceDiagram
  Client ->> Synternet: synternet.yields.api: "/?asset=123"
  Synternet ->> Synternet: send request to API Subagent owning synternet.yields.api stream subject
  Synternet ->> API Subagent: req: "/?asset=123"
  API Subagent ->> API Subagent: validate request, opt. add api_key
  API Subagent ->> External API: req: "https://yields-api.com?asset=123&api_key=456"
  External API ->> API Subagent: response
  API Subagent ->> Synternet: response
  Synternet ->> Client: response
Loading
  • External API secrets are not exposed, they are securely managed by API subagent.
  • Synternet does accounting. Manages access and payments for API usage.

Development

Use air for live reloading during development.

  1. Copy .env.example to .env and configure the environment variables as needed.
  2. Run the app:
air

Docker

  1. Build image.
docker build -f ./docker/Dockerfile -t api-subagent .
  1. Run container.
docker run -it -p 8080:8080 --rm --env-file=.env api-subagent

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •