Skip to content

Instantly share code, notes, and snippets.

View superkhau's full-sized avatar

Simon Ho superkhau

  • Vancouver, BC, Canada
  • 17:12 (UTC -07:00)
View GitHub Profile
@superkhau
superkhau / lb-api-route-versioning.md
Last active August 21, 2017 07:51
LoopBack - API versioning

Create config.local.js with the following:

var p = require('../package.json');
var version = p.version.split('.').shift();

module.exports = {
  restApiRoot: '/api' + (version > 0 ? '/v' + version : ''),
  host: process.env.HOST || 'localhost',
 port: process.env.PORT || 3000