mirror of
				https://github.com/jakejarvis/npqueue.git
				synced 2025-11-04 10:20:10 -05:00 
			
		
		
		
	host everything on heroku
This commit is contained in:
		
							
								
								
									
										0
									
								
								api/Godeps/Godeps.json → Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										0
									
								
								api/Godeps/Godeps.json → Godeps/Godeps.json
									
									
									
										generated
									
									
									
								
							
							
								
								
									
										0
									
								
								api/Godeps/Readme → Godeps/Readme
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										0
									
								
								api/Godeps/Readme → Godeps/Readme
									
									
									
										generated
									
									
									
								
							@@ -149,7 +149,7 @@ func getPlayerNoPixelInformation(id string) (p NoPixelPlayer) {
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// List handler for Heroku /api/list route
 | 
			
		||||
// List handler for now.sh /api/list route
 | 
			
		||||
func List(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
	err := loadPlayersJSON()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
@@ -168,6 +168,8 @@ func main() {
 | 
			
		||||
	addr := ":" + os.Getenv("PORT")
 | 
			
		||||
  
 | 
			
		||||
	http.HandleFunc("/api/list", List)
 | 
			
		||||
	http.Handle("/", http.FileServer(http.Dir("./static")))
 | 
			
		||||
 | 
			
		||||
	log.Printf("Listening on %s...\n", addr)
 | 
			
		||||
	if err := http.ListenAndServe(addr, nil); err != nil {
 | 
			
		||||
	  panic(err)
 | 
			
		||||
| 
		 Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB  | 
| 
		 Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB  | 
@@ -1,7 +1,7 @@
 | 
			
		||||
document.addEventListener("DOMContentLoaded", updateData, false);
 | 
			
		||||
 | 
			
		||||
async function fetchData() {
 | 
			
		||||
  let request = await fetch("https://hidden-depths-42970.herokuapp.com/api/list");
 | 
			
		||||
  let request = await fetch("/api/list");
 | 
			
		||||
  if(request.status == 200) {
 | 
			
		||||
    console.log("New JSON successfully fetched!");
 | 
			
		||||
    let data = await request.json();
 | 
			
		||||
		Reference in New Issue
	
	Block a user