Answer the question
In order to leave comments, you need to log in
How to upload an html file with an image?
I have a code that sends an html file:
const express = require("express");
var app = express();
app.use(express.static('public'));
app.get('/', function (req, res) {
res.sendFile(__dirname + '/index.html');
});
As well as the code that sends the image, where the path to the image is stored in an array
Question: how can I send an html file already with an image?
Answer the question
In order to leave comments, you need to log in
You cannot handle two identical GET paths. The router will only process the first one.
Images must be put in a public folder and written in html. You have static middleware connected, so there shouldn't be any problems.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question