How to deploy or Host a NESTJS API in CPANEL NODEJS server? - hosting

For the past three months I have been using NESTJS for Creating REST API. Now I need to host it in a Cpanel Nodejs server.
kindly let me know how I can host it?

Related

How to deploy docker containers to shared hosting

I create my last laravel app using docker, but I don't have any idea, how I can host my app?
I have phpMyadmin container and laravel app container.
How I can use it with whm server?
The most of users do that using docker cloud, but I don't find any tutorials or article talk about docker whm hosting what is the best practices doing that?
cPanel does not have Docker by default. If you have root access to machine which runs cPanel of course you can install it but you will not be able to control it via cPanel.
You can check these cPanel support pages:
https://support.cpanel.net/hc/en-us/articles/360062418794-Can-I-run-docker-on-a-cPanel-server-
https://support.cpanel.net/hc/en-us/articles/4402393047703-How-To-Install-Docker-Compose-
And I think you don't have root access to that shared machine. Therefore I think you are just looking for a way to publish your Laravel application on a shared hosting.
A basic Laravel application needs it's files on a server and a database connection (if needed). cPanel can provide both of this. You can upload your Laravel application files to your cPanel Website users home folder, arrange directory structure and point that Website's HTTP requests to your application's public folder.
You can use cPanel's File Manager or connect your server with a FTP client to upload and rearrange your application's files.
An application needs a database connection. In cPanel you can create a MySQL database and a MySQL user for it. Then you can change your database connection settings according to them.
You can check some other StackOverflow answers and tutorials for "Publising Laravel on a cPanel shared hosting"
How do I upload a laravel project on cPanel shared hosting?
https://medium.com/#kajan746/how-to-host-laravel-project-on-cpanel-83389d6d31e6
But as I said before; this has nothing with Docker. Those instructions shows how to use file manager and mysql wizards to prepare a production environment for Laravel on a shared cPanel host.

SSL_ERROR_INTERNAL_ERROR_ALERT when accessing api platform

API Platform V.2.6.5 with docker-compose downloaded from the official website
Problem : I can't send requests to the API, or access the UI from my browser. I'm facing a SSL_ERROR_INTERNAL_ERROR_ALERT
This is a brand new project I did not edit any file.
Note that i'm using Docker Toolbox for Windows and my docker is running on https://192.168.100.0, not localhost.
I tried on anoter PC where the domain for docker is localhost and it works.
However, the containers start well. I can even create entities and update my database.
Do you have an idea why this error is happening and how to resolve this ?
Most likely it's a caddy thing not having a valid SSL certificate, check at
docker-compose logs caddy
Here is an issue at caddy community: https://caddy.community/t/local-ip-address-creates-ssl-error/11314

Shopify CLI - How to start a local server without ngrok?

My organization blocks ngrok, so every time I run the Shopify serve command, it fails with a connection error.
So is there any way to just start the Shopify local server? that way I can use cloudfared to tunnel the local server to a subdomain.
When I search on google I found no answer to this question.
I had success running the server without the ngrok.
Here are my steps:
Prepare a cloud server, install Nginx.
config domain settings, and forward the request to your local port.
If you are using a router, only router has a public IP, so you need to forward the request to your pc. You could config it in the router.
then you need to update .env file, update host value
Go partner.shopify.com, app settings. put your URL to the whitelist.
use npm run dev to start your project.
I also set HTTPS in nginx. Due to ngrok server is far away from my location. so after using this way. the starting time is much faster.
Start the server by
npm run dev
instead of,
shopify app serve

Can I deploy a server to Heroku without a client?

I have built a backend server application without a frontend to it. Can I still deploy it to heroku ?
Sure. Heroku only hosts apps.
As long as your backend server application listens on a specified port, and is able to receive and respond to HTTP requests, you can host it on Heroku.

Uploading Angular 2 app to web hosting

So far I've used web hosting such as https://uk.godaddy.com/hosting/web-hosting for my websites, but seem like running angular 2 app has different way for publication.
So, since I found nothing about running Angular 2 app to be available public, and not only in localhost
My questions are -
What providers do allow such apps to be hosted on them? now I'm using npm start in my project folder to run my app, does it works the same way?
Since my backend is Laravel and supposed to be in the same domain as the Angular2 frontend, These providers allow to host the API's too?
Thanks in advance!
I have also hosted my laravel backend and angular front end using openshift. In terms to your application, I recommend you the following two providers.
Amazon Web Service. You can get 1 year free trial, EC2 is really wonderful to host whatever you want. In EC2, you can configure the environment for angular 2 and laravel by yourself. You can run any command including npm install in EC2
Openshift. You can freely create 3 gears to host your application. The environment is very easy to configure. If you want
to deploy angular 2, laravel applications, there are specific gears for these frameworks, so openshift
should be the best choice.
The answer to your second question : Yes, they allow to host the APIs !

Resources