func NewRouter(db *database.Database) http.Handler {
	router := httprouter.New()
	router.GET("/", Index)
	router.GET("/redirect", Redirect)
	router.GET("/redirect/:short_url", RedirectURL(db))
	router.POST("/shorten", ShortenURL(db))
	handler := cors.Default().Handler(router)
	return handler
}
// NewRouter creates a new httprouter Router,
// sets the handler for each route and adds middleware
// for enabling CORS with the default options.
//
// Returns an http.Handler
NewRouter creates a new httprouter Router,
sets the handler for each route and adds middleware
for enabling CORS with the default options.

Returns an http.Handler
// NewRouter creates a new httprouter Router // sets the handler for each route and adds middleware // for enabling CORS with the default options . // // Returns an http . Handler
func NewRouter(db *database.Database) http.Handler {
	router := httprouter.New()
	router.GET("/", Index)
	router.GET("/redirect", Redirect)
	router.GET("/redirect/:short_url", RedirectURL(db))
	router.POST("/shorten", ShortenURL(db))
	handler := cors.Default().Handler(router)
	return handler
}
func NewRouter ( db * database . Database ) http . Handler { router := httprouter . New ( ) router . GET ( " " , Index ) router . GET ( " " , Redirect ) router . GET ( " " , RedirectURL ( db ) ) router . POST ( " " , ShortenURL ( db ) ) handler := cors . Default ( ) . Handler ( router ) return handler }
NewRouter creates a new httprouter Router,
sets the handler for each route and adds middleware
for enabling CORS with the default options.
NewRouter creates a new httprouter Router sets the handler for each route and adds middleware for enabling CORS with the default options .