If you are done with the hello world example, Let's start with adding few routes to our application. Again this is super super basic routing only for beginners to show you how you can create http path for you application and handle with different function to return different response

NewServeMux to create route path and assign a handler for that path

mux := http.NewServeMux()
mux.HandleFunc(path, handler)

All routes in our new server

When you run this, please try out this URL in your browser to test our application

http://localhost:8080/
http://localhost:8080/books
http://localhost:8080/users
http://localhost:8080/posts
http://localhost:8080/posts/comments

Running our app

go run main.go