2017-09-02 1 views

答えて

0

main.jsファイルにこれらのAPI呼び出しを追加することができます。このファイルには、ウィンドウ作成コードも含まれています。

app.on('ready', function() { 
    //make api calls 

    var request = require('request'); 
    request('http://www.google.com', function (error, response, body) { 
     console.log('error:', error); // Print the error if one occurred 
     console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received 
     console.log('body:', body); // Print the HTML for the Google homepage. 

     // Create the browser window. 
     mainWindow = new BrowserWindow({ width: 1000, height: 625 }); 

    });  

    ...  
}); 
+0

すぐにお返事ありがとうございます。しかし、どのようにして電子でREST APIを作成しますか?助言がありますか? –

+0

'request' npmモジュールを使うことができます。私は同じ答えを更新しました。 – abskmj

+0

素晴らしいです、ありがとうございます。 –

関連する問題