Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Versioning mobile apps and apis

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →

Versioning mobile apps and apis

Our internal workshop material

Marek Kalnik

October 30, 2015

Transcript

11 slides
  1. SEMVER Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version

    when you make incompatible API changes, MINOR version when you add functionality in a backwards-compatible manner, and PATCH version when you make backwards-compatible bug fixes.
  2. IN APP COMMUNICATION ➤ let the user know what version

    he’s using, so he may communicate it to you ➤ show application version in the application itself (it may include build #)
  3. KEEP VERSION NUMBER AUTOMATIC ➤ gulp-bump ➤ an after_prepare_hook (http://devgirl.org/2013/11/12/three-hooks-

    your-cordovaphonegap-project-needs/):
 var version = require(__dirname + ‘../../package.json’).version ➤ gulp-git ➤ add a git tag with -a (demo time)
  4. HOW TO HANDLE VERSIONS ➤ call URL’s with /{version_number} ?


    HTTP GET:
 https://api.bamlab.fr/v2/hello ➤ add api-version header
 HTTP GET:
 https://api.bamlab.fr/hello
 api-version: 2 ➤ add Accept header
 HTTP GET:
 https://api.bamlab.fr/hello
 Accept: application/vnd.bamlab.v2+json
  5. INTEGRATE THE VERSIONING IN ROUTING ➤ http://restify.com/#versionned-routes ➤ http://www.slideshare.net/shakefon/hapidays-2014/9? src=clipshare

    ➤ http://www.slideshare.net/shakefon/hapidays-2014/18? src=clipshare ➤ https://github.com/felipeleusin/hapi-negotiator
  6. NOTIFY OLD VERSIONS ➤ send a DEPRECATED header and expose

    a /version route ➤ send a 410 GONE response if you are removing a ressource 410 GONE AND IT WON’T BE COMING BACK
  7. VERSION YOUR DATA MODEL ➤ think about metadata ➤ add

    meta_version_number ➤ add a transformer to transform the model before exposing it to either version

More Decks by Marek Kalnik

Other Decks in Technology