Skip to content
Weik.ioUniversity
Try Weik.io

Publish an API and call it

APIM 1 · 3:25

An HTTP service goes public through the hub's API gateway, and the first call returns its JSON. Publishing needs three documents, and the gateway lets no call through until a subscription allows it.

Download the mp4Recorded on 2026.2

What it covers

  • The API, version and deployment documents for invoices, a proxy to the upstream service
  • Publishing to production with one weikio apply, the deployment document included
  • An anonymous subscription for a first look
  • A call to api.example.com forwarded through the gateway to the upstream service
  • How the URL is built from the host name, the prefix, the version and the path
  • The API's page in the admin UI, with its versions and subscriptions

Commands in this video

Terminal
$ weikio apply -f ./finance/apis/
$ weikio subscription create finance/first-look --env production --api invoices --type anonymous
$ curl http://api.example.com/invoices/1.0/orders/42
Transcript
  1. 0:02This video publishes an API and calls it.
  2. 0:05The hub's API gateway serves any HTTP service;
  3. 0:10the upstream is the address the author writes.
  4. 0:16The hub is running, with the project finance.
  5. 0:19Production is live on api.example.com, and orders-api runs in production.
  6. 0:26No API is published yet.
  7. 0:34The API is three YAML documents in the finance folder, applied like everything else.
  8. 0:40The first names it: an API called invoices, served under the prefix invoices.
  9. 0:47The second is version 1.0, of type proxy:
  10. 0:51the gateway forwards the call to the upstream.
  11. 0:54Its cluster names the upstream's address, and the third deploys it to production.
  12. 1:04Applying is the whole publish.
  13. 1:07The hub stores the documents and turns them into the gateway's routing on the spot.
  14. 1:12One row per document, and the last line says the gateways were updated.
  15. 1:17Without the deployment, no gateway serves it.
  16. 1:22Nothing is open by default: a subscription says who may call.
  17. 1:27This one is anonymous: anyone on the host name can call, for a first look.
  18. 1:32Production asks before it changes, and a yes creates it.
  19. 1:36A real caller with a key comes in video two.
  20. 1:45Now a caller dials the public URL.
  21. 1:48The gateway matches the host and the path, and forwards the call to the upstream.
  22. 1:54The upstream receives the path below the version,
  23. 1:57so orders/42 reaches the orders route.
  24. 2:01The answer comes back through the gateway, and the caller gets the JSON.
  25. 2:09The URL is the host name, the prefix, the version and the path.
  26. 2:14api.example.com is production's own host name; the admin set it once.
  27. 2:21The prefix picks the API, the version picks which version answers,
  28. 2:26and the rest is the path the upstream sees.
  29. 2:34The admin UI keeps a page for the API.
  30. 2:38Its overview lists version 1.0, deployed in production, with the public URL.
  31. 2:45And the subscriptions section shows first-look, with no credential.
  32. 2:51The version's own page shows the route and the cluster it forwards through.
  33. 3:00Here is the whole picture.
  34. 3:02Three documents, one apply, a subscription, and the gateway serving the API.
  35. 3:08The upstream answered, and the caller saw only the URL.
  36. 3:12Video two gives a real caller a key and a rate limit.

Next in this track

APIM 2 · 3:08 Open it to a caller: a key and a limit Watched