I'm able to successfully display an image from my app.js file in the main ejs file, but when I try to set it as a background image, it doesn't show up. Any thoughts on what might be causing this issue?
This is my app.js file:
const express = require("express"),
app = express(),
bodyParser = require("body-parser"),
jade = require("jade"),
path = require('path'),
redis = require('redis');
images = [{image:"http://nuvotera.com/wp-content/uploads/2013/10/email-protection-banner-2.jpg"}];
app.use(bodyParser.urlencoded({extended:true}));
app.set("view engine", "ejs");
//render email page
app.get("/email", function(req, res){
res.render("emailMain", {image:images});
});
app.listen(3000, function(){
console.log("Email Server has started");
});
This is how I'm trying to use the image from the ejs page:
<tr>
<% for(var i=0; i < images.length; i++){ %>
<td class="vmlHero" background="<%= images[i].image %>" style="background-repeat:no-repeat" bgcolor="#000000" width="100%" height="430" valign="top">