8000 GitHub - Shimizu1111/lectio-api: Goaで作成した本に関するAPI
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Shimizu1111/lectio-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lectio-api

Goaの利用

cd design;goa gen github.com/Shimizu1111/lectio/design;cd ../;go build ./design/cmd/lectio && go build ./design/cmd/lectio-cli;./lectio

APIの例

  • Read
curl -X GET \
    -H "Content-Type: application/json" \
    -d \
    '{
        "bookId": 1
    }' \
'localhost:8000/v1/books/1'
  • ReadAll
curl -X GET localhost:8000/v1/books
  • Create
curl -X POST \
    -H "Content-Type: application/json" \
    -d \
    '{
        "userId": 1,
        "bookName": "坊っちゃん",
        "author": "夏目漱石",
        "publisher": "角川文庫",
        "price": 500,
        "bookStatus": "favorite"
    }' \
'localhost:8000/v1/books'
  • Update
curl -X PUT \
    -H "Content-Type: application/json" \
    -d \
    '{
        "bookName": "吾輩は猫である",
        "author": "夏目漱石",
        "publisher": "新潮文庫",
        "price": 700,
        "bookStatus": "favorite"
    }' \
'localhost:8000/v1/books/14'
  • Delete
curl -X DELETE localhost:8000/v1/books/14

About

Goaで作成した本に関するAPI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0