项目作者: thevalenciandev

项目描述 :
A simple RESTful API of beers and breweries
高级语言: Java
项目地址: git://github.com/thevalenciandev/beer-tracker.git
创建时间: 2019-08-22T17:24:31Z
项目社区:https://github.com/thevalenciandev/beer-tracker

开源协议:GNU General Public License v3.0

下载


beer-tracker

A simple RESTful API of beers and breweries.

Build Status

  1. GET http://localhost:8080/
  1. {
  2. "_links": {
  3. "beers": {
  4. "href": "http://localhost:8080/beers"
  5. },
  6. "breweries": {
  7. "href": "http://localhost:8080/breweries"
  8. },
  9. "profile": {
  10. "href": "http://localhost:8080/profile"
  11. }
  12. }
  13. }
  1. PUT http://localhost:8080/beers
  1. {
  2. "name": "Punk",
  3. "style": "IPA",
  4. "abv": 5.6,
  5. "brewery": {
  6. "name": "BrewDog"
  7. }
  8. }

=>

  1. {
  2. "name": "Punk",
  3. "style": "IPA",
  4. "abv": 5.6,
  5. "_links": {
  6. "self": {
  7. "href": "http://localhost:8080/beers/1"
  8. },
  9. "brewery": {
  10. "href": "http://localhost:8080/beers/1/brewery"
  11. },
  12. "beers": {
  13. "href": "http://localhost:8080/beers"
  14. }
  15. }
  16. }
  1. GET http://localhost:8080/beers/1
  1. {
  2. "name": "Punk",
  3. "style": "IPA",
  4. "abv": 5.6,
  5. "_links": {
  6. "self": {
  7. "href": "http://localhost:8080/beers/1"
  8. },
  9. "beers": {
  10. "href": "http://localhost:8080/beers"
  11. },
  12. "brewery": {
  13. "href": "http://localhost:8080/beers/1/brewery"
  14. }
  15. }
  16. }
  1. GET http://localhost:8080/beers/1/brewery
  1. {
  2. "name": "BrewDog",
  3. "_links": {
  4. "self": {
  5. "href": "http://localhost:8080/breweries/2"
  6. },
  7. "breweries": {
  8. "href": "http://localhost:8080/breweries"
  9. }
  10. }
  11. }
  1. GET http://localhost:8080/beers
  1. {
  2. "_embedded": {
  3. "beers": [
  4. {
  5. "name": "Punk",
  6. "style": "IPA",
  7. "abv": 5.6,
  8. "_links": {
  9. "self": {
  10. "href": "http://localhost:8080/beers/1"
  11. },
  12. "beers": {
  13. "href": "http://localhost:8080/beers"
  14. },
  15. "brewery": {
  16. "href": "http://localhost:8080/beers/1/brewery"
  17. }
  18. }
  19. },
  20. {
  21. "name": "Life & Death",
  22. "style": "IPA",
  23. "abv": 6.5,
  24. "_links": {
  25. "self": {
  26. "href": "http://localhost:8080/beers/3"
  27. },
  28. "beers": {
  29. "href": "http://localhost:8080/beers"
  30. },
  31. "brewery": {
  32. "href": "http://localhost:8080/beers/3/brewery"
  33. }
  34. }
  35. }
  36. ]
  37. },
  38. "_links": {
  39. "self": {
  40. "href": "http://localhost:8080/beers"
  41. }
  42. }
  43. }
  1. GET http://localhost:8080/breweries
  1. {
  2. "_embedded": {
  3. "breweries": [
  4. {
  5. "name": "BrewDog",
  6. "_links": {
  7. "self": {
  8. "href": "http://localhost:8080/breweries/2"
  9. },
  10. "breweries": {
  11. "href": "http://localhost:8080/breweries"
  12. }
  13. }
  14. },
  15. {
  16. "name": "Vocation",
  17. "_links": {
  18. "self": {
  19. "href": "http://localhost:8080/breweries/4"
  20. },
  21. "breweries": {
  22. "href": "http://localhost:8080/breweries"
  23. }
  24. }
  25. }
  26. ]
  27. },
  28. "_links": {
  29. "self": {
  30. "href": "http://localhost:8080/breweries"
  31. }
  32. }
  33. }