If your application's hostname exists under the smart.joyent.com domain
(for example, photos.smart.joyent.com) the DNS will automatically work.
If you'd like to use a hostname that you manage, for example, foo.com you
must configure your DNS with a CNAME record pointing to smart.joyent.com.
Git is a free software version control system. If you're running on a Unix you may already have a copy, otherwise you can download it from the Git website online.
Many people have asked the question Why Git?. Implicit in that question is another: "Why not something else?"
In truth, because the options are somewhat limited. The deployment and version control system must be distributed. We use the distributed nature of git to keep your applications in sync throughout the full cluster. It also allows you, the developer, to develop locally with no limitations.
When you create your application's host, there won't be any code there. You'll need to
git push before your application gets started. First of all you'll need some
code of course, so follow the disk layout convention, and maybe
write yourself a simple Hello World example.
Once you have code, you'll need to initialize git and get it set up to use the cloud. This isn't
as hard as it may sound. First of all issue a git init command in your application's
top-level directory. Then git add all the appropriate files. Finally, you need to
push the application to the cloud.
To do this, configure the repositories remote settings to the repository stated
on the Application's page, and the issue a git push origin master:refs/heads/master
command. Your application should make it's way to the cloud and be live on the internet, in full
color, very shortly.
Developing things on your local machine makes things much easier. For those of you who use Mac OS X we've made things much easier by developing a pre-built GUI version of the Smart Platform, which you can download here.
For those of you using other operating systems, the Smart Platform is Open Source, so you can build your own installation very easily, while we put together a pre-built version for you.
Your application, and therefore your git repository should have the following structure:
Your main code goes into bootstrap.js, and any code loaded at runtime will come either
from the JSP library, or your js directory.
Any calls to the system.filesystem extension API use the web directory as
their root path.
To write a simple, hello world application is trivial. Following the Disk Layout
question above, simply edit your bootstrap.js file, and insert the following code:
function main( aRequest ) {
return "Hello World";
}
That, trivial Hello World example will answer any request with the canonical, time-tested greeting.
We keep a regular eye on the Smart Platform topic on the Joyent Community Forums.
Yes! The source code to the platform and it's supporting infrastructure is available on GitHub from the Joyent account.