Deploy your first Node.js CRUD Application on cPanel with Newsys Managed Service

Crafting the Node.js Application

NB: You will also receive a mail regarding the cPanel username and credentials when you order any product.

Source: Newsys Hosting Solution
Click on Create Application.
Click on Create Button on the Top Right to craft your application.

Boom your application is ready.

Configure and note your database credentials

Search for MySQL in the cPanel search bar. Click on MySQL databases.
Create a new database with a database name.
Click on create a user.
Click on Add.
Select the appropriate privileges and click on Make Changes.

Creating the table for our testimonials:

Clicking on this will redirect you to the application.
Run the query on the field provided and click on Go.

Installing the dependencies

Enter the copied code, paste and hit enter.
npm init -y
npm install express body-parser cors mysql --save

Adding your code to the Application using File Manager.

Search for File Manager and click on the same to navigate.
The final output.
Fill the user, password, and database name as noted earlier in the tutorial.

Restart the Node.js server

Test the REST API Service

Testing the GET service https://<domain-name>/api/testimonials.
Testing the POST service https://<domain-name>/api/testimonials.
Testing the update PUT service https://<domain-name>/api/testimonials/:id.
Testing the update GET service https://<domain-name>/api/testimonials/:id.
Testing the DELETE service https://<domain-name>/api/testimonials/:id.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store