Serve static html content or dynamically render html with google cloud functions

Viewed 2297

Is it possible to render dynamic HTML (via express and ejs) or at least serve some static content via the cloud functions? I've creeaded a RESTful API and would love to server the HTML/CSS/JS from the same cloud function if possible. I tried to use

res.render("index.ejs") 

from my function and have added ejs to the package.json. According to express docs, specifying the file ending should require the associated view engine and render from the /views directory.

Does not work, complains that the view engine is not setup. Any ideas?

0 Answers
Related