Unfortunately, the way to do this is a bit complicated, because LoopBack doesn’t easily intercept all responses coming out of the API. Instead, you will need to add code for each model to the boot script, which is connected using the afterRemote method:
Inside /server/boot/ add the file (the name is not important):
module.exports = function(app) { function modifyResponse(ctx, model, next) { var status = ctx.res.statusCode; if (status && status === 200) { status = 201; } ctx.res.set('Content-Location', 'the internet'); ctx.res.status(status).end(); } app.models.ModelOne.afterRemote('**', modifyResponse); app.models.ModelTwo.afterRemote('**', modifyResponse); };
source share