Angular Electron with Nodejs using (MEAN Stack)

回眸只為那壹抹淺笑 提交于 2019-12-08 13:48:29

问题


I have create a MEAN Stack Application (Angular 6). Now I want to convert my application into Desktop Application with the same. we can achieve that in electron so that i read this Article. by using this Article I have created my application. but I am not get request from the application to server(node.js).

here is my angular req:

postlogindata(body: any): Observable<any> {

    return this._http.post(`http://192.168.1.174:8085/login`, body, {
      observe:'body',
     withCredentials :true,
      headers:new HttpHeaders().append('Content-Type','application/json')
    });
  }

here I'm receiving the request in Node server.js page

app.post('/login', UserConfig.loginVerify);

cors origin config

app.use(cors({
    origin: ['http://localhost:4200','http://localhost:8085','http://192.168.1.174:8085', 'http://127.0.0.1:4200'],
    credentials: true
}));

in web application I didn't get any error. but in desktop application i'm getting this error in my console. I have read many articles i didn't get any answer.

can anyone explain to me how to resolve this?

来源:https://stackoverflow.com/questions/54108769/angular-electron-with-nodejs-using-mean-stack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!