Currently, my approach involves using the following code to fetch my html file.
app.get("/", function (request, response) {
response.sendFile(__dirname + "/public_html/index.html");
})
The html file contains a form with method="post" and a submit button. I have included the necessary css code below.
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
On the javascript side, I am using this code snippet to retrieve the values from the submitted html form.
app.post("/survey", function (request, response, next) {
let firstname = request.body.fname;
let surname = request.body.sname;
etc...
However, there seems to be an issue when it comes to including the css stylesheet in the output. How can I ensure that the css is applied to the displayed content?
I also attempted to create an in-memory sql database using sqlite3 to store the values, but I'm unsure about how to use that data to generate an html output.