所以我下面的教程創建twilio的XML文檔等爲response
, (https://www.twilio.com/blog/2013/03/introducing-the-twilio-module-for-node-js.html)生成動態Twiml響應和保存的NodeJS服務器上
而不是發送它作爲迴應,我想在我的服務器上生成稍後訪問的文件。
像 - 本地主機/文件/ USERNAME/filename.xml中
這是我當前的代碼,該文件將作爲響應。
var resp = new twilio.TwimlResponse();
resp.say({voice:'woman'}, 'Thanks for calling!');
//Render the TwiML document using "toString"
res.writeHead(200, {
'Content-Type':'text/xml'
});
res.end(resp.toString());