apis/

directory
v0.0.0-...-b3f521c Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: Apache-2.0

README

Web - API

Learn the basics of building a web API in Go.

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/

Code Review

Route Versioning: Code | Test
Header Versioning: Code | Test
CRUD: Code | Test
Echo: Code | Test

Exercises

Exercise 1

Take the CRUD code from example 3 (CRUD) 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.


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

Directories

Path Synopsis
Sample program to show how to create a simple web api with different versions.
Sample program to show how to create a simple web api with different versions.
Sample program to show how to have a single route for the api but have access to either through configuration.
Sample program to show how to have a single route for the api but have access to either through configuration.
Sample program to show how to create a basic CRUD based web api for customers.
Sample program to show how to create a basic CRUD based web api for customers.
Sample program to show how to create a basic CRUD based web api for customers with a middleware component.
Sample program to show how to create a basic CRUD based web api for customers with a middleware component.

Jump to

Keyboard shortcuts

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