Here’s a preview of my first “real” Node.JS application. It’s a tiny (and quite obviously Dribbble-inspired) CMS. All post creation will be handled by an equally tiny API.
Assuming I can get it clean enough to not be too horribly embarrassed, I’ll be releasing the source once it’s done. It should be enough to get other Node newcomers headed in the right(ish) direction.
(P.S. If any of you would like to send a Dribbble invite my way, I’d really appreciate it! hi@paulstraw.com)
Node.js doesn’t have a filesystem method for cp, so here’s a tiny snippet of code for quick and dirty copying:
var fs = require("filesystem");
fs.cp = function(source, dest, callback){
var copy = require("child_process").spawn("cp", ["-r", source, dest]);
return copy.on("exit", callback);
};
fs.cp("file.txt", "file2.txt", function(err){
if(err) throw err;
console.log("copied file1.txt to file2.txt");
});
Showoff.io is “the easiest way to share localhost over the web.” It lets you create an SSH tunnel from any port on your local machine to the Showoff servers, so https://whatever.showoff.io —> localhost:9999