项目作者: trikanna

项目描述 :
create-react-app + json-server
高级语言: JavaScript
项目地址: git://github.com/trikanna/cra-json-server.git
创建时间: 2017-07-26T03:09:05Z
项目社区:https://github.com/trikanna/cra-json-server

开源协议:

下载


create-react-app + json-server

This project was bootstrapped with Create React App & typicode/json-server

setup

npm install & npm start

db.json

  1. {
  2. "posts": [
  3. {
  4. "id": 1,
  5. "title": "this is the first element on the collection",
  6. "authorId": 1
  7. },
  8. {
  9. "id": 2,
  10. "title": "And now time for a second one...",
  11. "authorId": 2
  12. },
  13. {
  14. "id": 3,
  15. "title": "... and the last one.",
  16. "authorId": 1
  17. }
  18. ],
  19. "authors": [
  20. {
  21. "id": 1,
  22. "name": "Santiago Camelo",
  23. "email": "trikanna@gmail.com"
  24. },
  25. {
  26. "id": 2,
  27. "name": "Pepe Trueno",
  28. "email": "pepetrueno@gmail.com"
  29. }
  30. ]
  31. }

api call

http://localhost:4000/authors?_embed=post