0

Long story short, my buddy has an A2 account (hosting his main app on PHP). I wanted to get my hands dirty with Node (particularly the deployment process) and he said I could use his hosting so I've created a subdomain. I've got the subdomain setup and running a hello world script

     var http = require('http');
     var server = http.createServer(function(req, res) {
     res.writeHead(200, {'Content-Type': 'text/plain'});
     var message = 'Hello world!\n',
        version = 'NodeJS ' + process.versions.node + '\n',
             response = [message, version].join('\n');
         res.end(response);
     });
     server.listen();

Does anyone have experience deploying node to A2? I'm still pretty new to Node but have enjoyed it so far! Forgive ignorance on the subject, I'm coming from a full stack PHP dev setup.

What I've done so far is work through the Heroku getting started tutorial and have a decent start on the site I'm working on. Locally works great and connecting to my db instance (MySQL). I'm using EJS for templating, etc.

I'm not really familiar yet with creating createServer() functions and such as the Heroku example doesn't seem to go through it but is doing "web: node index.js" from within the proc file.

 

Is there a way to get the configuration on A2 to run this type of deployment?

shenn
  • 859
  • 4
  • 17
  • 47
  • Why are you using a Heroku tutorial to deploy to A2 Hosting? – ChrisGPT was on strike Jul 16 '19 at 23:33
  • I used the Heroku tutorial to download a shell application a couple of months ago. That's just where the original barebones application came from. I'm not actually using the tutorial itself to deploy to A2. I'm using this: https://www.a2hosting.com/kb/installable-applications/manual-installations/installing-node-js-on-managed-hosting-accounts – shenn Jul 17 '19 at 01:59
  • You don't face any issue on A2? I see news that their server infected by malware. To setup node.js, you can read their documentation here: https://www.a2hosting.co.id/kb/installable-applications/manual-installations/installing-node-js-on-managed-hosting-accounts – Mark Spencer Jul 26 '19 at 03:37
  • A2's deployment configuration was faulty and out of date...this has been resolved now that they updated.... – shenn Mar 22 '20 at 17:29

0 Answers0