Separating jhipster back-end and front-end into two projects?

后端 未结 5 2082
春和景丽
春和景丽 2020-12-13 21:15

I\'m trying jhipster with token-based authentication. It works perfectly.

Now, I want to run back-end and front-end code on different domains. How c

5条回答
  •  半阙折子戏
    2020-12-13 22:05

    In addition to xeorem's answer above, I also had to modify the parse-links-service.js to handle the preflight OPTIONS responses, which don't have the "link" response header:

    var links = {};
    if (!angular.isObject()) {
        // CORS OPTIONS responses
        return links;
    }
    
    if (header.length == 0) {
        throw new Error("input must not be of zero length");
    }
    
    // Split parts by comma
    var parts = header.split(','); 
    
    ...
    

    Instead of adding API_URL to app.js, modify Gruntfile.js and add the API_URL to the ngConstants block for both DEV and PROD environments.

提交回复
热议问题