Serving from Files
Most servers will want to vend out and process content living in
files, too. Your next job is to make your server read files
from a subfolder and send them in a response back to the browser.
This is similar to what
was doing for you in earlier chapters.
Create a new folder named app inside of your chattrbox project folder. In it, create an index.html file with the following text:
You do not need any actual HTML in this file – it only needs some content that can be read. Your project folder should look like Figure 15.11.
Figure 15.11 Chattrbox project layout
Reading a file with the fs module
In index.js ...