Skip to content

Close to giving up getting started #197

Answered by gurgunday
lukepuplett asked this question in Q&A
Discussion options

You must be logged in to vote

Hey! Your first example is nearly correct. The issue is that Eta doesn't know where the files are (even though it tries a bunch of paths). You can either configure Eta beforehand using eta.configure() or supply a config object when calling renderFile. Take note that renderFile returns void IF you supply a callback function, if not it always returns a promise that resolves as the HTML (string), so no need for a type check.

This should work (assuming the login-oauth-google.eta file is in the same folder as index.js):

async function handleGetLoginGoogleViaEta(context) {
  const viewData = { title: "Squashed | Login", loginProviderName: "Google" };

  const html = await eta.renderFile("log.eta",

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@lukepuplett
Comment options

@gurgunday
Comment options

@lukepuplett
Comment options

Answer selected by shadowtime2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants