Exemple #1
0
func (d *LocationDirective) Apply(c api.Server, items map[string]interface{}) (bool, error) {
	if err := api.Remarshal(items, d); err != nil {
		return false, err
	}
	if d.Location == "" {
		return false, errors.New("location directive missing path")
	}
	r := c.Route(strings.TrimSpace(d.Location))
	r = d.Match.SetRoute(r)
	r = d.SetContentHandler(c, r)
	return false, nil
}