-
Notifications
You must be signed in to change notification settings - Fork 97
Publish Your Bot To A NodeJitsu For Free Hosting In 9 Easy Steps..
p0sixninja edited this page Mar 3, 2013
·
3 revisions
Set up your bot, make it completely bug free, then remove any type of console output ( console outputs cause a immediate failure as the server cannot handle any console requests) , so go ahead and // out all of those console.logs('');...
- Sign up for nodejitsu...
- From your node.js console type npm install jitsu
- Run the command from the console jitsu login Type in your login information, If your a new user, the script will ask you to create new login information.
- Change your console directory to your .js code... (cd)
- Now... You need to add something to the very top of your .js script, this code will initialize your own server, as the drones that nodejitsu uses have to see a initialized server within 4 seconds of deploying, or you will return with a error such as http://pastebin.com/iL69G18j... But im going to show you how to avoid this... :D, just add this very simple code to the top of your script, require('net').createServer().listen() ... This will initialize the server on port 80, so the drones see a server initialized, and not throw a error at you... Now that we have a server initialized, double-check your code for any console outputs... if your safe, move on to step 6
- Now that your directory should reflect your scripts directory, type in npm install --save ttapi, this will save a node_modules file with ttapi installed into that directory, be sure you do this will all of your dependencies.... ( or the script will fail ) (if you have a package.json file, skip number 8)
- Type jitsu deploy
- Fill in the information it asks, make up a subdomain that fancys your script, and when it asks for a engine version... fill in 0.8.0 , because not all of nodejitsu's servers are updated to 0.8.16, make up a version number for your script, a perfectly valid answer would be 1.0.0
- Jitsu should publish your app, and it should run it automatically...
You can manage your apps at https://webops.nodejitsu.com/apps/services
Thanks For Reading! Written by P0SIXNINJA