Skip to main content
Version: 2.8.x(Latest)

Introduction

WebServer requires the support of methods/objects to provide services. The ghttp package supports multiple route registration modes, providing developers with very powerful and flexible API functionality.

Route registration is the most core part of the entire WebServer and one of the most carefully designed modules in the goframe framework.

API documentation: https://pkg.go.dev/github.com/gogf/gf/v2/net/ghttp

Considerations

Starting from version v2 of the framework, the feature of standardized routing has been added, making it more suitable for engineering scenarios in business projects. It is recommended to use standardized routing in complex business projects: Standard Router

Documents

📄️ Registration - Object

Object registering executes route registration through an instantiated object. Each request is handled by the object, remaining in memory without being released. This document introduces methods related to object registering in the GoFrame framework, such as BindObject, BindObjectMethod, and BindObjectRest, and explains how objects are registered following RESTful design. Additionally, it discusses built-in route variables, naming conventions, and Init and Shut constructor and destructor methods.