Using Handlebars for Email/Invoice Template only with MERN Stack for API - handlebars.js

So I'm using MERN stack, and I need to generate some invoices/pds with Handlebars and some Templates in Server, can I do that, to use it only for specific things like what I mentioned?
And how can I do that as I'm new into Server rendering

Related

Is nextJS backend serverless?

I am trying to understand NextJs. I understand that nextJs is a React Based framework. I also understand that NextJs has the functionality of creating a backend using nodeJS. Is this backend made up of serverless functions?
NextJS is a front-end framework at its core. The Node.js backend it creates is in support of its ability to perform SSR/ISR data fetching.
When you say
is this backend made up of serverless functions?
I think you are referring to the NextJS pages/api directory, which provides an easy way to create API endpoints. While you can choose to treat these as serverless functions (Vercel, the creators of NextJS, provide an easy way to do this), you can also choose to have these API endpoints served any way you want, like by an Express server for example. To do this you would have code in your pages/api/<api-route-name>.js file that fetches data from another server. You can choose also to not use the pages/api directory at all and make your server calls how you normally would in a React app.
You may also opt to customize NextJS routing/server behavior completely by using a custom server. While NextJS does provide an opinionated structure, you can really do whatever you want on the backend.

Is there an ejs equivalent for css?

I am currently developing a website using node.js and express. I am using EJS as view engine. I want to be able to inject variables into my CSS, in a way that works similar to EJS.
(For those that are not familiar with EJS: I'm quite sure it works similar to the way you inject variables from the backend into HTML in PHP)
My CSS needs to be in a seperate file (not inline). This process also needs to run on the backend.
Is there any module I can use to do this in node.js? (Or some other way to achieve this?)

Can I include PHP templates in a TWIG base template or vice versa?

I am currently in the process of refactoring and restructuring an existing Symfony 2 application.
There are a few base templates and all other templates inherit from them. Right now, all the templates are PHP. I am planning to migrate the application to TWIG.
The problem is that this application is already in use and while migrating I am also expected to add new features to the application. This means I can not freeze the current state of the application, fully migrate to TWIG and then continue working with that.
This means that a migration to TWIG is only possible in small steps, i.e. I can only migrate a handful of templates before I have to deploy a new release. There will also be some new templates for the features I am adding and I would also prefer to add these in TWIG format.
My plan right now is to migrate the base templates to TWIG first and then include the existing PHP templates in those new base templates. Afterwards, I would continue migrating the other templates in small batches.
Looking at documentation online, it is possible to have both the PHP and TWIG template engines enabled simultaneously. However, I could not find any tutorials, examples or documentation mentioning that you could not only have those two engines side by side but also have templates from one engine include templates from the other engine.
Is there a way to mix templates from those two engines as I described?
Even if there are similarities between both engines (they still do the very same thing), they are working internally in their own ways, the architecture and the code are very different.
Templates provided in PHP are managed by the Templating Component.
Templates provided in Twig are managed by the Twig engine.
Have a look to both codes, and you'll understand why we just can't compare/mix them.
For example:
slots from php engine plays with string overwriting
blocks from twig engine plays with class overloading
So even if you were able to access the twig-compiled file using a tricky import, you'll not be able to overload a block by the simple fact that your php template isn't a class.

Is it possible to develop a meteor application as an embedded component on an existing page?

Of course this can be done using an iframe, but i'm looking for a solution where the application is injected in the dom on load, using all of the stylesheets and scripts that are already available on the page.
This is useful for websites that need a component with rather difficult requirements (like live push updates), that are available out of the box when using meteor.
I don't want to embed a meteor application inside of an iframe, because of the need of duplicating stylesheets of scripts on the main page.
Because Meteor is a full-stack application framework, this won't be possible. Meteor isn't like a typical client-side javascript framework where you can just hook it into some other platform, it's a platform itself. So I would ask: what are you trying to do, and why do you think inserting Meteor into the page will help solve your problem?

Question about using remoteobject in modules

I have a number of modules in my flex application and in each module I use a remoteobject to retrieve dynamic data from the server related to each module. Recently I read a couple of comments in some blogs people saying that remoteobjects should not be used in modules, instead they should be in the main application. Is this true and why? And if it's true, what would I do with the resulthandler in the main app, since the code is very specific to each module, there's a lot of data manipulation and code setting values of components in the module, how would the handler in the main app access the components inside the module?
Thanks
It seems ridiculous to me to avoid using RemoteObject in a module. The whole purpose of a Module is to be a self contained portion of an application. And there is no reason why remote service calls can't be part of the self contained piece.
Do you have links to blog posts making these claims? I'm sure any such claims would be context specific (as are most best practices).

Resources