I am using strongloop/loopback for the first time. There is some rudimentary instruction online for versioning an API:
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
};
What I don't see, is a recommended way of maintaining multiple versions of an API. So, for example, I could have a legacy 1.4 version and new 2.0 version running at the same time. Is there a best practice for doing so?
Edit: I have accepted @Overdrivr's answer as it is accurate at time of writing. However, there is an open issue on Github regarding this feature with a user planning to submit a PR. Hopefully this functionality will be added in a future iteration.