I'm building a web application with nodejs and express which has two views, one for writing and submitting the written data to a database, and another one for viewing the data from the database.
What would be the simplest way to serve the html file with the content loaded from the database? Would I need to use a templating engine or is there a simpler way of adding the loaded content to a html file? I'm trying to avoid bloating the app with unnecessary overhead and keeping it as simple as possible.
You can have a simple express app, with a "pubic" directory for serving your static html. Then you can implement API endpoints with express.js for saving data and retrieving data.
The express "generator" can generate a simple skeleton of what you're looking for: https://expressjs.com/en/starter/generator.html
You can use an ORM like Bookshelf.js to handle database operations from within your API endpoints
Considering you are using DB for the data, I assume the content is not static. It is changing from time to time or from user to user. So if you want to display different data in different situations you have two options.
You should you a template engine, insert your data, and return to enduser or you should send the static html content to the request, and then ask for the dinamic data with ajax from the client-side.