Skip to main content

tcb routes / tcb domains / tcb cors

Manage the entry points of the HTTP gateway: routing rules decide which upstream service receives a request, custom domains provide the addresses, and security domains control which web origins may call CloudBase with the Web SDK.

Command index​

Gateway routes​

CommandPurpose
tcb routes listList routes, filter by domain or upstream type
tcb routes addCreate a route bound to a function, CloudBase Run service, or static hosting
tcb routes editUpdate forwarding and auth settings of an existing route
tcb routes deleteDelete routes

Custom domains​

CommandPurpose
tcb domains lsList custom domains
tcb domains addBind a custom domain with direct, CDN, custom, or EO access
tcb domains editUpdate the certificate, access type, and other domain settings
tcb domains rmUnbind a custom domain
tcb domains cache purgeSubmit a CDN or EO cache purge
tcb domains cache taskQuery purge progress and history

Security domains​

CommandPurpose
tcb cors listList security domains
tcb cors addAdd security domains
tcb cors rmDelete security domains

Reference​

DocumentContent
Configuration file - gatewayThe gateway.routes field of cloudbaserc.json
Forwarding versionSemantics of the upstreamResourceVersion field, which pins traffic to a specific function or CloudBase Run version

Notes​

  • Security domains (tcb cors) manage the CORS allowlist for the Web SDK; custom domains (tcb domains) are the access domains of the HTTP gateway, require an SSL certificate, and work together with routes
  • The imperative route commands require the domain to be bound with tcb domains add; tcb deploy binds domains declared in gateway.routes automatically
  • The domain commands accept --platform-id <platformId> for platform edition resource pools (v3.8.3+); cache purge does not support the platform edition
  • Cache purge lives in tcb domains cache, not in tcb routes

Deprecated​

tcb service is deprecated since v3.0.0. It stays backward compatible but is no longer maintained.

CommandBehaviorReplacement
tcb service createCreate an HTTP gateway pathtcb routes add
tcb service deleteDelete an HTTP gateway pathtcb routes delete
tcb service listList HTTP gateway pathstcb routes list
tcb service switchEnable or disable the HTTP gatewaytcb routes edit (enable field, per route)
tcb service auth switchEnable or disable HTTP gateway authenticationtcb routes edit
tcb service domain bindBind a custom domaintcb domains add
tcb service domain unbindUnbind a custom domaintcb domains rm
tcb service domain listList custom domainstcb domains ls