📋
Eather
  • Eather
  • Module Development
    • Create new Module
    • Empty Module
    • Installable
    • Upgradable
    • Routable
    • Eventable
    • Cronable
    • Callable
Powered by GitBook
On this page

Was this helpful?

  1. Module Development

Routable

Add function MapRoutes() to make module Routable.

.
.
.

func (m module) MapRoutes() {
	router := eather.GetRouter()

	router.HandleFunc("/", controllerEmpty).Methods("GET")
}

func controllerEmpty(w http.ResponseWriter, r *http.Request) {
	eather.SendJSONResponse(w, eather.Response{Message: "Empty controller"})
}

.
.
.

This will set controllerEmpty for path /.

PreviousUpgradableNextEventable

Last updated 5 years ago

Was this helpful?