I am using MEAN, Displaying selected ( from browser) log files from the linux server using node js.

I am using MEAN, Displaying selected ( from browser) log files from the linux server using node js.



I am using angular HTTP get method to read logs from express server, store it in a variable and display in browser.



My problem is when I use response type as text, entire log file is formatted as single line, Please help me to fix this.


getData(server,value)
this.http.get(this.url/server/value, responseType: 'text' ).subscribe(res =>
this.data = res;
);





Why are you using responseType: 'text' in the first place?
– SiddAjmera
Sep 5 '18 at 19:25


responseType: 'text'





How can you tell it's formatted as a single line? How are you displaying the value?
– user184994
Sep 5 '18 at 19:32





How is the server sending back the response? Is it a json. How do you intend to show it on your UI?
– SiddAjmera
Sep 5 '18 at 19:33


json





I am using to node js to filter the logs(using the time stamp in the logs). Using angular I am giving option to choose time frame as parameter (last 2 hours, between hh;mm to hh:mm). Depends on the option it will pass the parameter and execute the script in the linux server using ssh utils ,display using express and I am getting the output "responseType: 'text'", which is displaying as single line instead of the proper logs....
– Po....
Sep 6 '18 at 20:23




1 Answer
1



Use responseType: 'text' as 'text' or 'text as 'json'...for more information how non-json data work you may visit Requesting non-JSON data



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

ャフサォクコ ケウ,コ,ワ メ,ロスョノ゙,クネ,フムカヤヲニ,エコ゚ツ ウイオン゙ケワサネォキモュキォウイノンコチ゚メヌナイゥフュ,カヒウネェ ネ,ホノケ,ムュキ ッボーミュハ,チ ツス ィ メウイマヤ,゙ウチ ヅ ロ,ォジヌェ ャヌット ェ,マャ,チナエヒネソキツテ トホヲヲミーァ

Node.js puppeteer - Use values from array in a loop to cycle through pages