package main

import (
	"fmt"
	"log"
	"net/http"
)

func main() {
	router := NewRouter()

	// By default, listen to port :9532 (:ykdb)
	fmt.Println("Listening on port 9532...")
	log.Fatal(http.ListenAndServe(":9532", router))
}

package main

import (
	"flag"
	"fmt"
	"log"
	"net/http"
	"strconv"
)

func main() {
	// Read in the supplied flags from the command line to determine the port.
	// By default, listen to port :9532 (:ykdb)
	var portFlag int
	flag.IntVar(&portFlag, "port", 9532, "Port to listen on for http requests.")
	flag.Parse()
	port := strconv.Itoa(portFlag)

	router := NewRouter()
	fmt.Printf("Listening on port %v...", port)

	log.Fatal(http.ListenAndServe(":"+port, router))
}

Allow program to listen on user-specified port
Allow program to listen on user-specified port

yakdb now supports listening to a user-specified port.
It will still run on :9532 if no port is specified.

Resolves #1.
