router.go 365 B

12345678910111213141516
  1. package main
  2. import (
  3. "github.com/go-martini/martini"
  4. "github.com/martini-contrib/binding"
  5. )
  6. // martini router
  7. func route(m *martini.ClassicMartini) {
  8. // regist a device
  9. m.Post("/v1/devices/registration", binding.Json(DeviceRegisterArgs{}), RegisterDevice)
  10. // auth device
  11. m.Post("/v1/devices/authentication", binding.Json(DeviceAuthArgs{}), AuthDevice)
  12. }