#Complete NestJS noob - questions

5 messages · Page 1 of 1 (latest)

peak meadow
#

I am trying to make sense of NestJS. I copied the tutorial code and the Hello World page is loading.
Then I plugged in my custom template engine and I am able to render a page.

Here is one first question: how can the template engine adapter know where templates are located? I need the path to load nested templates.
Or is there a callback function that I can configure the template engine to use for loading template files?

My code so far:
https://github.com/jido/extremepriv/tree/main/privateserver

More questions to come... Like what is an "AppService" for?

GitHub

Extreme privacy demo page. Contribute to jido/extremepriv development by creating an account on GitHub.

sweet ice
#

the docs also mention:

views, the directory where the template files are located. Eg: app.set('views', './views'). This defaults to the views directory in the application root directory.

meaning there is a folder called "views" where the templates are read from
and app.set('views', './views') will change the directory

peak meadow
#

I see a standard callback __express(path, options, callback) and res.render mentioned. Let me hunt that render function

peak meadow
#

That’s just what express uses for @Render. But I saw that Consolidate.js uses:

file = join(dirname(path), partialPath + extname(path));