Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
eve - restful api for human
Search
begood
January 24, 2018
Programming
74
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
eve - restful api for human
this is my slide for presenting in python meeting in PYMI and VCCLOUD
begood
January 24, 2018
Other Decks in Programming
See All in Programming
Next.js: The final boss of Web Performance
guaca
0
260
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
590
R8 の設定見直しでアプリサイズ削減
andpad
0
220
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
430
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
気持ちぃ〜角丸 Squircle
ryu1013
0
310
phperだってパンチカードでコーディングしたい
o0h
PRO
0
340
The Rails Doctrine Decade
koic
2
590
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
460
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
すこし踏み込む CancellationToken
htkym
2
1.7k
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
58k
Music & Morning Musume
bryan
48
7.4k
HDC tutorial
michielstock
2
960
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
530
Facilitating Awesome Meetings
lara
57
7.2k
Automating Front-end Workflow
addyosmani
1369
210k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
Evolving SEO for Evolving Search Engines
ryanjones
0
330
Raft: Consensus for Rubyists
vanstee
142
7.8k
Transcript
eve RESTful API for humans Quangvn - VCCLOUD
Eve được phát triển bởi
Mục lục: • Phần 1. Đôi điều về eve •
Phần 2. Tính năng • Phần 3. Ưu điểm, nhược điểm
Phần 1. Đôi điều về eve Đơn giản cùng với
setting.py mặc định ở cùng thư mục DOMAIN={“speakers”: {}} from eve import Eve app = Eve() if __name__ == '__main__': app.run()
Run simple $: python2 run.py * Running on http://127.0.0.1:5000/ (Press
CTRL+C to quit)
Call to api $: http GET :5000/blogs
{ "_items": [ ], "_links": { "parent": { "href": "/",
"title": "home" }, "self": { "href": "blogs", "title": "blogs" } }, "_meta": { "max_results": 25, "page": 1, "total": 0 } }
{ "_items": [ ], "_links": { "parent": { "href": "/",
"title": "home" }, "self": { "href": "blogs", "title": "blogs" } }, "_meta": { "max_results": 25, "page": 1, "total": 0 } } Những object trả về
{ "_items": [ ], "_links": { "parent": { "href": "/",
"title": "home" }, "self": { "href": "blogs", "title": "blogs" } }, "_meta": { "max_results": 25, "page": 1, "total": 0 } } Phần HATEOAS
{ "_items": [ ], "_links": { "parent": { "href": "/",
"title": "home" }, "self": { "href": "blogs", "title": "blogs" } }, "_meta": { "max_results": 25, "page": 1, "total": 0 } } Phần phân trang
Chỉnh sửa setting.py DOMAIN={“speakers”: {}} # mongo connection MONGO_HOST =
'localhost' MONGO_PORT = 27017 MONGO_USERNAME = 'eve_admin' MONGO_PASSWORD = 'eve_admin' MONGO_DBNAME = 'eve_demo' # /blogs RESOURCE_METHODS = ['GET', 'POST'] # /blogs/<id> ITEM_METHODS = ['GET', 'PATCH']
Chỉnh sửa schema blogs = { 'item_title': 'blog', 'additional_lookup': {
'url': 'regex("[\w]+")', 'field': 'name' }, 'schema': { 'name': { 'type': 'string', 'minlength': 1, }, 'content': { 'type': 'string', 'minlength': 1, } } }
Phần 2: Tính năng của eve Mongo Filter: ?where={“lastname”: “pymi”}
Phần 2: Tính năng của eve Python Filter: ?where=lastname==”pymi”
Phần 2: Tính năng của eve Sorting: ?sort=-_created (Giảm dần
theo ngày tạo)
Phần 2: Tính năng của eve Pagination: ?max_results=20&page=2
Phần 2: Tính năng của eve Projection: ?projection={“lastname”: 1} (Chỉ
trả về trường lastname)
Phần 2: Tính năng của eve Embedded: ?embedded={“blogs”: 1} (Trả
dữ liệu kèm theo blog)
Phần 3: Ưu điểm, nhược điểm Ưu điểm: • Dễ
sử dụng • Dễ triển khai • Hỗ trợ nhiều tính năng cần thiết để làm ra API • Có nhiều extension
Phần 3: Ưu điểm, nhược điểm Nhược điểm: • Schema
chưa có phần đổi tên trường • Chỉ dành cho API
Q & A
Lời cám ơn!