重写用于REST导出的Drupal映像URL

I'm experimenting using Drupal to serve content to an Angular app. I've got a good bit of experience with Angular but Drupal I'm completely unfamiliar with.

I've got a REST export setup for a new content type I created and I have an image included in the export.

<img src="/sites/default/files/2017-03/imoji.png" width="396" height="398" alt="JQ" typeof="foaf:Image" />

What's the appropriate way to re-write the image URL so I get an absolute path to the image which includes the domain - www.drupalvm.dev? My proof of concept is being served from angular.drupalvm.dev so the browser is looking for the image @ angular.drupalvm.dev/sites/default/files/2017-03/imoji.png.

if you have id of file you can do it on drupal side :

$file = file_load($fid);
$absolute_url = file_create_url($fid->uri);

Otherwise if you need to begin from src value (fastest way but not the classier) :

$src = '/sites/default/files/2017-03/imoji.png';
$uri = str_replace('/sites/default/files/', 'public://', $src);
$absolute_url = file_create_url($uri);

https://api.drupal.org/api/drupal/includes%21file.inc/function/file_create_url/7.x