How to read the txt file of the link taken in axios?

Viewed 2491

i want to read , text of file in rest API

enter image description here

i am using marked for convert txt to markdown and show to vue.js

But I do not know how to read the contents of the file

I also saw raw-loader in my search, but I do not know how to give contents of the file text in axios

enter image description here

1 Answers

You can use a syntax like below to read the text file:

axios.get('http://127.0.0.1:8000/markdownFile/test.txt').then(function(response){
    this.markDownData = response.data
});

Then you can set the markDownData variable to your view

Related