Create-React-App on Lightsail: DNS and SSL issues - node.js

I'm trying to deploy a CRA on Lightsail and I'm having issues with the SSL cert and DNS.
I have tested the A record with no errors. http://52.40.123.5:3000/ displays my react app but abechoi.com does not, even if I click on advanced.
I added "homepage": "http://abechoi.com", no change.
As for the SSL, I found a free cert.pem and key.pem off a website and I tried running "HTTPS=true SSL_CRT_FILE=cert.pem SSL_KEY_FILE=key.pem npm start", no change, possibly because the domain name has issues.
Anyways, if anyone could offer some kind of help, I would greatly appreciate it. From what I've read AWS Amplify is easier but I want more experience working my way around a Linux CLI.

You can issue a Free SSL using let's encrypt and then use it for your node command line:
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-using-lets-encrypt-certificates-with-wordpress
ignore the Wordpress part here, you just need to get the pem files and hook it to node

Related

How to deploy node.js app onto a production server?

im new to node.js and have struggled to find information about deploying apps.
Say that I have written a small one file node.js app and would like to deploy it onto a prod server. If I deploy the app.js file alone I cant use "node app.js" to run as the app is missing package.json and the node modules. But deploying all these files/folders to the server seems like the wrong way to do it as it would take ages to transfer all the node_modules.
The only resources that I can find online use localhost node server which doesn't really show what I need. I'm using MobaX to deploy to a specific IP if this is useful.
Sorry if this is a stupid question, most of my experience is in front-end so haven't had the opportunity to play around with this and don't have anyone to ask for guidance.
Please don't mark down the question, I will happily edit the question if any feedback on doing so is provided.

How to hot reload on netlify?

Netlify just as example, same question with CloudFlare Pages etc.
In the past I setup my own server with node and react/vue.
I have my node setup on a server because I don't want to install node and node packages on my local machine.
When I was developing I SSH into the server with port forwarding.
So I ran a dev server on port 8888 (npm run dev) on the server and opened http://localhost:8888 in my local browser.
When I make a change to the files I can immediately see the effects without running npm run build.
I am thinking about using a service like netlify because its the right thing to do? But how can I see the changes I make without actually running build?
Is this even possible or do you use theses service only when you are building a website that rarely changes? I am probably missing something. But not sure how to proceed.
I don't know what's the right way. I am very open to suggestions.
Edit: These services that I mentioned are meant for build only. See answer below. I am still leaving this question so people can post suggestions.
You cannot do this. Those services are only for hosting the build version of your app. You have to develop it locally and push the build to these services.
Why would you even want to run a development version online?

HTTPS on node.js issue

I am very new to Node and I'm trying to install a SSL certificate. Ordered one online and I got two files:
domain.com.ca-bundle
domain.crt
How should I go about installing the certificate on Node.js server?
After reading through this guide I found that we need one more additional which is private.key so I'm trying to understand how to go about it.
I'd really appreciate any inputs on how to proceed. Apologies if this is the wrong place to ask.
Environment:
I run Debian 9 on my VPS with Node.js installed.

Configuring KeystoneJS App with LetsEncrypt & Heroku

I'm using the letsencrypt option of KeystoneJS to automatically configure and maintain HTTPS information for my project. I'd like to be able to configure this to work with a custom domain on Heroku; I've followed a previous guide to actually configure the HTTPS (which appears to work), but when I load HTTPS on my site, it says that my certificate is only applicable for *.herokuapps.com, and not for my actual domain. Do I need to configure the Heroku SSL Beta addon in order for HTTPS to explicitly work with my domain? If I do, how can I provide it with the keys and certificates that it asks for, even though my HTTPS information is being generated on the server and not locally? (Rather, how might I be able to generate that information locally, then have both Keystone and Heroku use identical information)?
EDIT: As I understand it, I can manually pass a certificate and key to the SSL options in Keystone, but I have no way of automatically maintaining those certificates unless I instantiate them with the letsencrypt Keystone option (as far as I know). I'm still confused how I can manually create the keys/certificates the first time, then use letsencrypt to maintain and update them (and then communicate the new information with Heroku when they need to be updated).
I ended up figuring out how to upload the certificate to Heroku after creating it with Let's Encrypt. It isn't automatic and needs to be manually re-uploaded every three months, but it's better than nothing.
I wrote a guide about how to solve this issue, which you can read here. I used Windows 10 for the process, but it should be fine on Mac OS X/Linux as well.

Using Let's encript SSL certificates on OpenShift for node app

I have a node/socket.io chat app on OpenShift. The directory layout is the following:
I would like to start using SSL on the site, specifically with Let's Encrypt, which is free. However, no matter how many tutorials I Google and try out (on a separate hosting for testing, of course), I simply can't make it work properly.
I'm sure to some this is a silly question, but I'd appreciate if someone could tell me how to do this with OpenShift.
If anyone knows of an easy to understand, step by step tutorial, I would appreciate a link.

Resources