I’ve got a remote server running a server express that returns a tiger image on the link.
On this link, there is an express server running:
var express = require('express');
const router = require('express').Router();
app.use(express.static('public'));
router.get('/lookforit/:id',(req, res) =>{
res.sendFile(__dirname+'/public/images/'+req.params.id)
})
app.listen(PORT, function () {
console.log('Server is running on PORT',PORT);
});
And I have the tiger image named tiger.jpg on the /public/images.
Indeed, The link returns an image as expected.
But when trying to insert it into HTML, In an incomprehensible way, HTML doesn’t display it:
<!DOCTYPE html>
<html>
<body>
<img
src="https://pub.streetzer.fr/upload/lookforit/tiger.jpg"
alt="Tiger"
/>
</body>
</html>
Can someone tell what’s missing please?