now serving files from a downloads directory so that the executables
can be downloaded from a ci job
This commit is contained in:
		
							parent
							
								
									22a3589d1d
								
							
						
					
					
						commit
						7461167484
					
				| @ -7,6 +7,7 @@ import ( | ||||
| 	"log" | ||||
| 	"net" | ||||
| 	"net/http" | ||||
| 	"os" | ||||
| 	"regexp" | ||||
| ) | ||||
| 
 | ||||
| @ -21,6 +22,11 @@ func parsePublicId(path string) (publicId string, _ error) { | ||||
| 
 | ||||
| func main() { | ||||
| 
 | ||||
| 	downloadDir := "downloads" | ||||
| 	if len(os.Args) == 2 { | ||||
| 		downloadDir = os.Args[1] | ||||
| 	} | ||||
| 
 | ||||
| 	admin := converge.NewAdmin() | ||||
| 	registrationService := websocketutil.WebSocketService{ | ||||
| 		Handler: func(w http.ResponseWriter, r *http.Request, conn net.Conn) { | ||||
| @ -53,6 +59,7 @@ func main() { | ||||
| 
 | ||||
| 	http.HandleFunc("/agent/", registrationService.Handle) | ||||
| 	http.HandleFunc("/client/", clientService.Handle) | ||||
| 	http.Handle("/downloads/", http.StripPrefix("/downloads/", http.FileServer(http.Dir(downloadDir)))) | ||||
| 
 | ||||
| 	// Start HTTP server
 | ||||
| 	fmt.Println("Rendez-vous server listening on :8000") | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user