github.com/web-platform-tests/wpt.fyi@v0.0.0-20240530210107-70cf978996f1/api/azure/routes.go (about)

     1  // Copyright 2019 The WPT Dashboard Project. All rights reserved.
     2  // Use of this source code is governed by a BSD-style license that can be
     3  // found in the LICENSE file.
     4  
     5  package azure
     6  
     7  import "github.com/web-platform-tests/wpt.fyi/shared"
     8  
     9  // RegisterRoutes adds all the api route handlers.
    10  func RegisterRoutes() {
    11  	// notifyHandler exposes an endpoint for notifying wpt.fyi that it can collect
    12  	// the results of an Azure Pipelines build (by the provided ID).
    13  	// The endpoint is insecure, because we'll only try to fetch (specifically) a
    14  	// web-platform-tests/wpt build with the given ID.
    15  	shared.AddRoute("/api/checks/azure/{id:[0-9]+}", "azure-notify", notifyHandler).
    16  		Methods("POST")
    17  }