mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 12:36:16 -04:00
extending: How to add module to website (#323)
This commit is contained in:
parent
92c010fc60
commit
25b1a2e82f
1 changed files with 4 additions and 0 deletions
|
@ -294,6 +294,10 @@ Notice how the loaded module is type-asserted: `g.Gadget = val.(Gadgeter)` - thi
|
||||||
|
|
||||||
If your host module defines a new namespace, be sure to document both that namespace and its Go type(s) for developers [like we have done here](/docs/extending-caddy/namespaces).
|
If your host module defines a new namespace, be sure to document both that namespace and its Go type(s) for developers [like we have done here](/docs/extending-caddy/namespaces).
|
||||||
|
|
||||||
|
## Module Documentation
|
||||||
|
|
||||||
|
Register the module to make a new Caddy module show up in the module documentation and be available in http://caddyserver.com/download. The registration is available at http://caddyserver.com/account. Create a new account if you don't have one already and click on "Register package".
|
||||||
|
|
||||||
## Complete Example
|
## Complete Example
|
||||||
|
|
||||||
Let's suppose we want to write an HTTP handler module. This will be a contrived middleware for demonstration purposes which prints the visitor's IP address to a stream on every HTTP request.
|
Let's suppose we want to write an HTTP handler module. This will be a contrived middleware for demonstration purposes which prints the visitor's IP address to a stream on every HTTP request.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue