Routes
You can add a new route to the server with AddRoute()
.
package main
import ( "github.com/razshare/frizzante/web" "main/lib/handlers")
func main() { servers. New(). AddRoute(routes.Route{ Pattern: "GET /", Handler: handlers.Welcome, }). // Adds route. Start()}
package handlers
import "github.com/razshare/frizzante/connections"
func Welcome(con *connections.Connection) { con.SendMessage("Hello") // Sends text.}