muxers/

directory
v0.0.0-...-86d22a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2017 License: Apache-2.0

README

Web - Muxers/Routers

Learn the basics of using some of the more popular routers and routing support.

Notes

  • The standard library has much of what you need to build services and apps.
  • The http package provides the building blocks.
  • There are other great packages in the Go ecosystem to help.

https://golang.org/pkg/net/http/
https://golang.org/doc/articles/wiki/
github.com/gorilla/pat
github.com/julienschmidt/httprouter
github.com/labstack/echo

Code Review

Pat router: Code | Test
Httprouter router: Code | Test
Echo router: Code | Test

Exercises

Exercise 1

Take the CRUD code from example 1 (Pat) and extend the code by adding a PUT and DELETE route. Make sure the routes for both calls ask for the id of the customer. Write two new handler functions and bind them into the service so they can be processed. Finally add tests to validate the new routes are working. For both calls redirect the user back to the index page.


All material is licensed under the Apache License Version 2.0, January 2004.

Directories

Path Synopsis
Sample program to show how to use the pat router.
Sample program to show how to use the pat router.
Sample program to show how to use the httprouter router.
Sample program to show how to use the httprouter router.
Sample program to show how to use the echo toolkit.
Sample program to show how to use the echo toolkit.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL