I had an idea that I should be able to manage a public Node.js deployment entirely from within GitHub, without having to install a Unix virtual machine.
It turns out that Nodejitsu does exactly what I wanted-- but their documentation is a horror (at least for a newbie like me). It's actually just a few easy steps to connect the two.
You have to go to the Settings page on your GitHub project. Then click on the Service Hooks tab, then Nodejitsu.
Fill in your username and password, check Active, and click Update Settings.
If you switch over to Nodejitsu there will be a new app in your list of apps.
You can make a change in GitHub and it automatically appears in Nodejitsu.
Restart the app to make the changes appear.
Now I have to figure out how npm works over there, or if it does.
I got stuck much earlier.
I tried to deploy my own repository, and entered my username and password, as above, but I keep getting a message saying that I am not me.
Here's an example.
I don't think this has anything to do with the username and password (esp because there's another error message for incorrect username and password). It's some kind of permissions thing, but I have no idea what needs configuring. About ready to look for another way to deploy. Oy.
Never mind.
The script I deployed just did a console.log ("hello") and exited.
For some reason Nodejitsu sees that as an error and gives a mystifying error message. Par for the course for Unix software, imho.
On that theory, I deployed Brent's test server, the one that returns blue or green, and it works. For a little while at least this link will launch Brent's app.
The next questions:
How do I do jQuery stuff in node? I want to use the same XML processing code on the server that I use in the client, if possible.
How do I do the equivalent of npm? I have to load the Amazon libraries. There must be a howto somewhere.
Notes
The Nodejitsu app just wrote a file to an S3 bucket. (7:23PM, Niners up 3-0.)
I have it writing a new test file every time someone accesses the page. For some reason it writes two or three files for every hit. Maybe it's because my browser is looking for icon files or some other weird stuff. Probably.
Here's an example of one of the test files. (As with the other files it may disappear after a while.) And here's the source code of the server app that writes to S3.
Niners up 10-3.
Earlier this month I switched this site over to yet another new CMS. This one has a bunch of new templating and scripting features, and is written in JavaScript, and has unique scaling advantages. I will be writing about the new CMS, at much length, when the software is released.
I wanted to note that I have a new template that is patterned after the look of the Medium site. I really like the look of their posts, as do many other people. I especially like the way it uses the image at the top of the page. I've always loved using images in the right margin of my posts, now I can play with much larger ones at the top of the posts. It makes blogging a lot more fun, for me -- and I hope you like it too. (I know the subhead can be hard to read. Still thinking about what to do about that.)
There's a "drawer" in the left margin, which you can access by clicking on the little "hamburger" icon in the upper left corner. The menu items can be clicked to reveal previous articles, links to related sites, my rivers and GitHub repos. I'm still working on that part of the design. Actually I'm still working on it all.
I wanted to give credit for the design inspiration.
"Only steal from the best."
I do have a choice of templates for each post, and I imagine most posts will use the plain "outline" template, suitable for starting discussions (an example). I expect I'll use the new format for special occasions, like this one.
As always Scripting News is about scripting, and news -- and the intersection between the two. And play and pushing the leading edge, and keeping us all independent and hopefully for a little while still, free.
Let's have fun!