{"id":319,"date":"2023-01-25T03:52:56","date_gmt":"2023-01-25T03:52:56","guid":{"rendered":"https:\/\/ecodebook.wordpress.com\/?p=319"},"modified":"2023-01-25T03:52:56","modified_gmt":"2023-01-25T03:52:56","slug":"setup-nodejs-app-on-namecheap-cpanel","status":"publish","type":"post","link":"https:\/\/blog.mycarts.shop\/?p=319","title":{"rendered":"Setup NodeJS App on Namecheap cPanel"},"content":{"rendered":"\n<p class=\"has-vivid-purple-color has-text-color has-medium-font-size\"><strong>Step 1<\/strong><\/p>\n\n\n\n<p>Create nodejs app in the cPanel.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/nodejs1-1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/nodejs1-1.jpg?w=1024\" alt=\"\" class=\"wp-image-324\" width=\"706\" height=\"259\" srcset=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/nodejs1-1.jpg 1441w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/nodejs1-1-300x110.jpg 300w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/nodejs1-1-1024x377.jpg 1024w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/nodejs1-1-768x282.jpg 768w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/nodejs1-1-809x298.jpg 809w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/a><\/figure>\n\n\n\n<p class=\"has-vivid-purple-color has-text-color has-medium-font-size\"><strong>Step 2<\/strong><\/p>\n\n\n\n<p>Upload you project files to the root folder <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>models\nviews\n.htaccess\nindex.js<\/code><\/pre>\n\n\n\n<p class=\"has-vivid-purple-color has-text-color has-medium-font-size\"><strong>Step 3<\/strong><\/p>\n\n\n\n<p>Run the below code<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;nodejs$] source \/home\/usename\/nodevenv\/nodejs\/12\/bin\/activate &amp;&amp; cd \/home\/usename\/nodejs\n&#091;nodejs$] npm init<\/code><\/pre>\n\n\n\n<p>Update the package.json like below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>  {\n  \"name\": \"myapp\",\n  \"version\": \"1.0.0\",\n  \"description\": \"test app\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"test\": \"echo \\\"Error: no test specified\\\" &amp;&amp; exit 1\"\n  },\n  \"author\": \"\",\n  \"license\": \"ISC\"<strong>,\n  \"dependencies\": {\n    \"body-parser\": \"^1.20.0\",\n    \"express\": \"^4.18.1\",\n    \"express-handlebars\": \"^6.0.6\",\n    \"handlebars-helpers\": \"^0.10.0\",\n    \"mysql\": \"^2.18.1\"\n  },\n  \"devDependencies\": {\n    \"nodemon\": \"^2.0.18\"\n  }<\/strong>\n}\n<\/code><\/pre>\n\n\n\n<p class=\"has-vivid-purple-color has-text-color has-medium-font-size\"><strong>Step 4<\/strong><\/p>\n\n\n\n<p>Run below code.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#091;nodejs$] npm install express express-handlebars --save\n&#091;nodejs$] npm install body-parser --save\n&#091;nodejs$] npm install mysql --save\n&#091;nodejs$] npm install handlebars handlebars-helpers --save\n&#091;nodejs$] npm install -g nodemon\n&#091;nodejs$] nodemon server.js<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Step 1 Create nodejs app in the cPanel. Step 2 Upload you project files to the root folder Step 3 Run the below code Update the package.json like below: Step 4 Run below code.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-319","post","type-post","status-publish","format-standard","hentry","category-nodejs"],"_links":{"self":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts\/319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=319"}],"version-history":[{"count":0,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts\/319\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}