कंटेंट पर जाएँ
TakoAPI
स्किल्स पर वापस

ngamux

hadihammurabi द्वारा

Web & Frontend Development
417clawskills.sh द्वारा बताए गए डाउनलोड
0व्यूज़
0 लाइकइस स्किल को लाइक करने के लिए साइन इन करें
—अभी तक कोई रेटिंग नहीं
आपकी रेटिंग

संक्षिप्त

Build and modify web services using ngamux, a simple HTTP router for Go.

विवरण

यह स्किल क्या करती है

ngamux is a lightweight HTTP router for Go that handles route definition, middleware chaining, and request/response processing. It supports path parameters, wildcards, route grouping, and multiple response types including JSON, plain text, and HTML templates.

ngamux provides a fluent request/response API and tree-based route matching without requiring a heavyweight framework, keeping Go web service code concise and idiomatic.

इसे कब इस्तेमाल करें

  • Adding authentication middleware to a group of protected API routes
  • Parsing JSON request bodies into Go structs for a REST endpoint
  • Serving file uploads from a multipart form with size limits
  • Organizing versioned API routes under a common /api/v1 prefix
  • Returning HTML template responses for a server-rendered Go web app

उदाहरण वर्कफ़्लो

इनपुट

User asks: create a REST endpoint that accepts a JSON user payload and returns the created user

एजेंट
  1. 1

    Define a POST route with mux.Post("/users", createUserHandler)

  2. 2

    In the handler, decode the request body using req.JSON(&user)

  3. 3

    Validate and process the user struct in Go

  4. 4

    Send a 201 Created response with ngamux.Res(rw).Status(http.StatusCreated).JSON(user)

आउटपुट

A working POST /users handler that parses JSON input and returns the created user as JSON

इंस्टॉलेशन

clawhub install hadihammurabi/ngamux

CLI कमांड चलाएँ, या प्रॉम्प्ट को Claude Code, Cursor, Codex या जो भी कोडिंग एजेंट आप इस्तेमाल करते हैं उसमें पेस्ट करें।

लिंक