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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
begood
January 24, 2018
Programming
75
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
Transcript
22 slides
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!
Other Decks in Programming
See All in Programming
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
610
AI Augmentation Techniques with Liberty
ivargrimstad
1
550
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
260
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
140
선언형 햅틱 라이브러리 진동을 소개합니다
l2hyunwoo
1
330
まずはコードより業務と向き合う:テーブル解体のためにPdMを呼んだ話
sakawe_ee
0
270
SODA - FACT BOOK(EN)
sodainc
1
280
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
320
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
790
Getting Started with Vibe Coding
miccheng
0
250
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
360
Featured
See All Featured
Music & Morning Musume
bryan
48
7.5k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
570
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
620
Well, that’s weird…
csswizardry
1
200
Leo the Paperboy
mayatellez
11
2.5k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
540
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
880
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7.1k