Examples using... http.ListenAndServe()

Recent
NotFoundHandler returns a simple request handler that replies to each request with a “404 page not found” reply.
ListenAndServe listens on the TCP network address addr and then calls Serve with handler to handle requests on incoming connections. Accepted connections are configured to enable TCP keep-alives.
HandleFunc registers the handler function for the given pattern in the DefaultServeMux. The documentation for ServeMux explains how patterns are matched.
Handle registers the handler for the given pattern in the DefaultServeMux. The documentation for ServeMux explains how patterns are matched.
FileServer returns a handler that serves HTTP requests with the contents of the file system rooted at root.
FileServer returns a handler that serves HTTP requests with the contents of the file system rooted at root.