Oops, I left a few lines at the top of main.go out of the post: here's the 
whole thing:
// main.go
package main

import (
    "fmt"
    "net/http"
)

func handleRoot(w http.ResponseWriter, r *http.Request) {
    http.ServeFile(w, r, "webpages/main.html")
}

func main() {

http.HandleFunc("/", handleRoot)
http.Handle("/css/", http.FileServer(http.Dir("webpages/css")))
http.Handle("/js/", http.FileServer(http.Dir("webpages/js")))
fmt.Println("listening on port 8877")
http.ListenAndServe(":8877", nil)
}

>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to