apiservice.js

angular.module('homepage').
factory('Server', function($http) {
    return {
    	// USER
        login   : function(user) {
            return $http.post('/auth/user/login', user);
        },
        logout  : function() {
            return $http.get('/auth/user/logout');
        },
        register: function(data) {
            return $http.post('/auth/user/register', data);
        },
        signup: function(data) {
            return $http.post('/auth/user/signup', data);
        },
        // DOWNLOAD
        downloadDocx: function (data) {
            return $http.post('/api/download/docx', data, {responseType:'arraybuffer'});
        },
        downloadRtf: function (data) {
            return $http.post('/api/download/rtf', data);
        },
        // RESUME
        saveResumeData: function (data) {
            return $http.post('/api/resume/save', data);
        }
    };
});