API Design

I found couple helpful links for anyone who wants to build API project:

http://blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/

https://scotch.io/tutorials/keeping-api-routing-clean-using-express-routers

So at this point the API structure I think will be following:

db – get list of all databases
db/:dbname – get, put, post, delete db named as :dbname

db/:dbname/collection – get list of all collections in db named as :dbname
db/:dbname/collection/:colname – get, put, post, delete collection named :colname in db named as :dbname

db/:dbname/collection:colname/doc – get list of all documents in collection named :colname in db named as :dbname
db/:dbname/collection/:colname/doc/:docid – get, put, post, delete document with id :docid in  collection named :colname in db named as :dbname

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s