Adding a Web Handler Endpoint

Configure Go web endpoints by editing service.yaml and generating boilerplate.

172|5|Updated Sep 9, 2022
One-click install
npx skills add https://github.com/microbus-io/fabric --skill adding-a-web-handler-endpoint
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Adding a Web Handler Endpoint
Source: https://github.com/microbus-io/fabric/tree/main/.claude/skills/microbus/add-web
Command: npx skills add https://github.com/microbus-io/fabric --skill adding-a-web-handler-endpoint

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides developers to create or modify a web endpoint of a microservice by defining its Go function signature, route behavior, and metadata in service.yaml, ensuring consistent endpoint configuration.

Core Features & Use Cases

  • Create a new web endpoint in a microservice by updating service.yaml with a Go function signature and endpoint metadata.
  • Modify an existing endpoint to adjust its signature, method, or description, and regenerate boilerplate as needed.
  • Ensure tests, documentation, and versioning steps are followed for safe rollout and consistency.

Quick Start

Add a webs entry to the microservice's service.yaml including the signature, description and method; then run the boilerplate generation and implement the business logic.

Frequently Asked Questions about Adding a Web Handler Endpoint

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a web endpoint to a Go microservice?

To add a web endpoint to a Go microservice, you insert a webs entry into the service.yaml file specifying the Go function signature, description, and HTTP method, then run boilerplate generation and implement the logic.

What do I need to configure in service.yaml to expose a new HTTP endpoint?

Configuring a new HTTP endpoint in service.yaml requires adding a webs entry that defines the Go function signature, a description of the route behavior, and the HTTP method for the microservice.

Can I modify an existing microservice web endpoint signature and regenerate the boilerplate?

Yes, you can modify an existing microservice web endpoint by updating its signature, method, or description in service.yaml, and then running the boilerplate generation again to update the Go code.

What steps should I follow after updating a microservice web endpoint for safe rollout?

After updating a microservice web endpoint, you should implement the business logic, run tests, update documentation, and follow versioning steps to ensure safe rollout and configuration consistency.

Does this approach to creating web endpoints require manual Go route registration?

No, creating web endpoints this way does not require manual Go route registration because the service.yaml configuration drives the boilerplate generation, automatically setting up the HTTP route metadata.