For FrozenRidge.co, our full-stack consulting business, we needed a simple, fast and easy-to-maintain landing page. The requirements were:
Our starting point was actaully 100% static files. We considered using a static website compiler for templates. However, due to the need to handle contact requests, we needed something dynamic.
As we already know and love node.js, we decided to build a tiny web application server for our site. We used the following components and services:
Swig templates are very similar conceptually to Django or Mako templates. Swig supports template inheritance aka blocks, which we wanted.
One of the main purposes of our landing page is to showcase our areas of expertise, and allow potential customers to start a conversation with us as easily as possible.
Our philosophy is to solve hard problems for our customers, with the absolute minimal amount of hassle. The reason you work with FrozenRidge is because we deliver quality results, fast and nonsense-free.
Initially, we simply wanted our contact form to send us nicely-formatted emails. In the future, we might store requests in a database or CRM. But for now, email is good enough.
With Hapi.js and Nodemailer, we wrote an AJAX API endpoint that sends e-mail with server-side validation in just a few lines of code. To reliably send email in the cloud, we use Mailgun. Mailgun is an awesome service and their free plan is quite generous.
We decided to use Nodejitsu as our web host. A nice property of node.js is that one process can handle quite a bit of traffic. Hence, all we needed to get started was a single cloud-hosted node.js process, and they offer this for only $3/month.
We could have easily used a private server, but using a PaaS provider like Nodejitsu offers the following advantages:
Feel free to use our quick and dirty sourcecode as a starting point for your own Node.JS & Hapi.JS landing page!