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

Crafting the Node.js Application

  • After logging in navigate to Services. ( Client Area > Services )
  • Click on the product that you have purchased and on the left sidebar ‘Login to cPanel’.
Source: Newsys Hosting Solution
Click on Create Application.
Click on Create Button on the Top Right to craft your application.
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.
  1. Open phpMyAdmin tool in the cPanel to access the database created via the frontend tool.
Clicking on this will redirect you to the application.
Run the query on the field provided and click on Go.
Enter the copied code, paste and hit enter.
npm init -y
npm install express body-parser cors mysql --save
Search for File Manager and click on the same to navigate.
The final output.
  1. Now create the index.js file and populate the code as below.
Fill the user, password, and database name as noted earlier in the tutorial.
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