mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
middleware/root: add it (#330)
This PR adds the *root* middleware that specifies a path where all zone file (the *file* middleware is the only consumer now) can be found. It works the same as in Caddy. Documentation can be found in the README.md of the middleware. Fixes #307
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
_ "github.com/miekg/coredns/middleware/pprof"
|
||||
_ "github.com/miekg/coredns/middleware/proxy"
|
||||
_ "github.com/miekg/coredns/middleware/rewrite"
|
||||
_ "github.com/miekg/coredns/middleware/root"
|
||||
_ "github.com/miekg/coredns/middleware/secondary"
|
||||
_ "github.com/miekg/coredns/middleware/whoami"
|
||||
)
|
||||
|
||||
@@ -17,6 +17,10 @@ type Config struct {
|
||||
// The port to listen on.
|
||||
Port string
|
||||
|
||||
// Root points to a base directory we we find user defined "things".
|
||||
// First consumer is the file middleware to looks for zone files in this place.
|
||||
Root string
|
||||
|
||||
// Middleware stack.
|
||||
Middleware []middleware.Middleware
|
||||
|
||||
|
||||
@@ -73,6 +73,7 @@ func RegisterDevDirective(name, before string) {
|
||||
// (after) them during a request, but they must not
|
||||
// care what middleware above them are doing.
|
||||
var directives = []string{
|
||||
"root",
|
||||
"bind",
|
||||
"health",
|
||||
"pprof",
|
||||
|
||||
Reference in New Issue
Block a user