gocd – No ‘Access-Control-Allow-Origin’ header is present on the requested resource

I want to upload artifacts to a gocd pipeline using their API which is POST /go/files/:pipeline_name/:pipeline_counter/:stage_name/:stage_counter/:job_name/*path_to_file. I have nodejs application with google oauth2 enabled. I am uploading files and uploading them using POST request in angularjs.

<script>
    angular.module('fupApp', [])
        .directive('ngFiles', ['$parse', function ($parse) {

            function fn_link(scope, element, attrs) {
                var onChange = $parse(attrs.ngFiles);
                element.on('change', function (event) {
                    onChange(scope, { $files: event.target.files });
                });
            };

            return {
                link: fn_link
            }
        } ])
        .controller('fupController', function ($scope, $http) {

            var formdata = new FormData();
            $scope.getTheFiles = function ($files) {
                angular.forEach($files, function (value, key) {
                    formdata.append(key, value);
                });
            };

            // NOW UPLOAD THE FILES.
            $scope.uploadFiles = function () {

                var request = {
                    method: 'POST',
                    url: 'https://<mydomain1.net>:8154/go/files/FirstPipeline/13/defaultStage/1/defaultJob/',
                    data: formdata,
                    headers: {
                        'Content-Type': 'multipart/form-data'
                    }
                  };

                // SEND THE FILES.
                $http(request)
                    .success(function (d) {
                        alert(d);
                    })
                    .error(function () {
                    });
            }
        });
</script>

I am trying to request from mydomain2.net to mydomain1.net(this is gocd). However in browser after selecting a file and clicking on submit, I get this error after I inspect(Ctrl+Shift+I).

Access to XMLHttpRequest at ‘https://mydomain1:8154/go/files/FirstPipeline/13/defaultStage/1/defaultJob/‘ from origin ‘http://mydomain2:3000‘ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

Where should the Access-Control-Allow-Origin header be added at GoCD side?

Source: New feed
Source Url gocd – No ‘Access-Control-Allow-Origin’ header is present on the requested resource