You're stringifying the locale
object before rendering it. Strings have no forEach
method, only arrays! So long as you don't actually plan on printing the whole content
object to the page, and assuming that locale
is a Javascript object, you can skip the stringify part entirely, and just do:
res.render('index', {title: "This is a test server", content: locale});