github.com/bosssauce/ponzu@v0.11.1-0.20200102001432-9bc41b703131/system/api/server.go (about)

     1  // Package api sets the various API handlers which provide an HTTP interface to
     2  // Ponzu content, and include the types and interfaces to enable client-side
     3  // interactivity with the system.
     4  package api
     5  
     6  import "net/http"
     7  
     8  // Run adds Handlers to default http listener for API
     9  func Run() {
    10  	http.HandleFunc("/api/contents", Record(CORS(Gzip(contentsHandler))))
    11  
    12  	http.HandleFunc("/api/content", Record(CORS(Gzip(contentHandler))))
    13  
    14  	http.HandleFunc("/api/content/create", Record(CORS(createContentHandler)))
    15  
    16  	http.HandleFunc("/api/content/update", Record(CORS(updateContentHandler)))
    17  
    18  	http.HandleFunc("/api/content/delete", Record(CORS(deleteContentHandler)))
    19  
    20  	http.HandleFunc("/api/search", Record(CORS(Gzip(searchContentHandler))))
    21  
    22  	http.HandleFunc("/api/uploads", Record(CORS(Gzip(uploadsHandler))))
    23  }