Hello!
Currently I have an app running similarly to how it’s done in this article
the TL;DR is it’s an express server being served through netlify functions.
Recently I added ejs to the express server and a new ./views folder that is rendered with an express render call
return res.render('pages/share', {...})
the views folder is in the root of the directory and included in the netlify.toml
[build]
functions = "functions"
publish = "client/public"
[functions]
node_bundler = "esbuild"
included_files = ["/views/**/*.ejs"]
The views directory is configured as follows in the express app
app.set('view engine', 'ejs');
app.set('views', './views');
app.engine('ejs', ejs.__express);
This all works fine when running the netlify dev command locally but breaks after deploying to production. I suspect that i need an absolute path to the views directory, but I’m not sure how to get it.
I’ve tried using path.join(__dirname, '/views') but that doesn’t seem to be working. I was wondering if anyone had more insight into how the paths of the included_files are configured in a netlify function.