Heroku: Could not load the default credentials (Dialogflow API) - node.js

I am trying to build a chatbot using Node.JS, Dialogflow & Socket.Io and it works fine on my local machine. But when I want to access my agent from my Heroku app I get this error: Could not load the default credentials.
I have defined the environment variables in the Config Vars on Heroku, but it doesn't seems to work that way. Anyone had this problem before?
Thanks,
Matthieu

Related

Azure Function App remove headers set by a Nest.js App

Thanks for the time reading this.
I am developing an App using Nest.js framework, running it on Azure App service.
I am using a library which set some headers before sending the response to the client.
When I run my code on local runtime, everything seems working properly.
But, when I use Azure Function App local runtime, headers seems to disappear.
There is a screenshot of the request using local runtime
As you can see in the “Response Headers” section there some headers set.
And then a screenshot of the same server code running on Azure Function App local runtime
As you can see in the “Response Headers” section some headers are missing.
My question is, how do I configure Azure Function App so that it does not remove headers set by my Nest.js App ?
I’ve been looking into MS documentation about that, but I did not find anything.
Thank you. for your help

Getting environment variables from nodejs app cpanel

So I'm using cPanel with Setup Node.js App plugin for an node/express app. (don't asky why cPanel)
Everything is working as expected in development, except for environment variables in production, I set up them manually from the cPanel interface, I restarted/stopped the app, logging the process.env on the server and I don't see the env variables there (not to say when trying to call them they are undefined).
When doing res.json(JSON.stringify(process.env)); i get a bunch of variables except for the one I manually wrote in cPanel variables interface.
It is important for me to store these variables as a secret key because they are API credentials.
Does anyone know what I might have misconfigured or had this problem?

Having issues with Heroku deployment

I am trying to upload a MEAN stack app for the first time, so I am not sure I am doing it the best way but here it is.
I have deployed my nodeJS server to one domain and it seems to be working fine - response message
but I am having problems with the client part.
I deployed the angular code to a different domain (not sure if that's how you do it) and I am getting this error:
error link
Here is a link to my github project repository if it could provide some more information - https://github.com/igalM/igal-school
I used the Heroku CLI and Container Registry to upload the code with Dockerfile.
Thank you in advance!
Looks like I just had to add a server.js to my client folder. SOLVED!

How do I deploy Apollo client and Node Express/Sequelize API?

I have an Apollo app with an express/sequelize API. It runs fine in dev. Can anyone tell me what it should look like in prod? Ive added .env environment variables. Where do those get set on the web server? Do I change the url in Apollo client? How do I build/prepare the API for deployment to web server through FTP? I use bitbucket for CI/CD. I really don't what I'm supposed to do.
So basically the answer is, with Node, you can't just deploy to a static server and expect it to work. The app created is already it's own server. Therefore, you have to host on in a service like AWS, Heroku or Now to get it to work. This may seem obvious to some but at first this wasn't clear to me.

Mailing functionality using node.js's nodemailer fails in openshift

I have an issue with nodemailer support in openshift. I created a simple node.js application that sends a mail using nodemailer, following the hello world example given in https://github.com/andris9/Nodemailer
The mail is sent from a gmail id to two other gmail ids. This functionality is invoked while rendering the home page of my application. It worked well when the node.js application was run locally. I created a node js application in openshift and tested the application locally. I worked well. But on deploying the app to open shift, the mailing functionality failed, though the home page was rendered properly.
Is this mailing feature supported in openshift? Or am I missing something, like some extra configuration that is required in openshift for enabling this mailing support?
Thanks.
Hmm, this should work ... can you try changing the port # you are using -- say try 587 with TLS in the
wellknown.js configuration. See if that works.
The other thing to check is that your email provider allows authenticated connections from Amazon AWS EC2 hosts.
HTH

Resources