Help in making book readable on website!

Hey guys,
I am working on a personal website for a friend. My friend has written a book and he wants people to read the book in the browser itself.

So, what I am trying to achieve here is to put each of the chapters of the book in separate .txt files and retrieve that text on the webpage.
Similar to what Kindle does on cloud reader here:
Just that I want the content of the book in .txt file while Amazon has it in the cloud.

I think I am not able to convey my question very well. But still, if anyone can help, I would be very grateful.
Basically, I want to create an ebook reader and do not w to put all the text of the book in my HTML file or create multiple HTML files for the task. Is there any way to achieve what I am trying to do?

Thanks in advance.

A very simple solution would be to use fetch() to get the text document. Googling ‘javascript fetch’ will give you a ton of links.