Keywords: NodeJS - AWS - How to - Other
Middle-aged total noob programmer here. Spent 3 weeks building a little CRUD web app. Using node, express, postgres, bootstrap stack. Got it working fine on localhost. It could read and write from the db, I integrated Google Oauth 2.0 using Passport, and everything worked fine. I then migrated the Postgres database from local to the cloud (ElephantSQL), and everything still worked.
Then I tried to get the code into the cloud, and this is where I am stuck. I am running it on Amazon Lightsail, and I am unclear from every tutorial and doc I have seen whether or not I am supposed to also run Apache or not. On localhost everything worked fine using just node, and I never used Apache.
Anyway, a little more detail: I did get the DNS pointed over to my Lightsail static IP, and all the Node code and modules all set up (I think), but it still just showed the Bitnami page. So then, following a few tutorials' advice, I tweaked a few Apache configuration files and ran it, and ■■■, my home page showed up. So I thought it was working, but then the rest of the site functionality didn't work. Two specific clues so far:
Google OAuth (after you click the button) gives this error:
The redirect URI in the request, http://127.0.0.1:3000/auth/google/redirect, does not match the ones authorized for the OAuth client.
A dynamic webpage that hits the db with a simple select query gives this error:
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /1.
Reason: Error reading from remote server
Anyway, I am hoping that Apache is redundant here and I can turn it off, configure something else w/Node properly, and suddenly the app will work again, but I really don't know what I am doing. Thanks in advance for any help.