07 April 2012

Built a simple site with Node.js

I had a simple site to build for a friend (a local business called It's A Gift) so I decided this would be a good time to get going with Node.js. Initially I wanted to see if I could do this on Windows, but with my earlier issues with it, I decided to just stick with Ubuntu. More and more I'm preferring working in Ubuntu.

Number 1 goal here was to do coffeescript end to end. Got that working fairly easily. My setup looks like this: 

- HTML Markup: Coffeekup: https://github.com/mauricemach/coffeekup
- MVC: Express:  http://expressjs.com/

I wouldn't say it was easy exactly, there were some minor bumps along the way. But I was pretty impressed with just how easy it was considering how little I knew going into it. Node just wants to get out of your way so you can get your site going. 

Another thing that I like about this setup is all of the markup and code looks fairly similar: 

Markup: 

div '.top.child', ->
  img '.logo', src: "images/logo.png", alt: "It's a Gift logo"
div '.bottom.child', ->
  h3 'Opening April 2012'
  p style: 'margin-bottom: 40px;'

CSS:


light_green = #B8CD88
dark_green = #64893D
beige = #F4BF7F
orange = #F79323
sea_green = #73A4A2
sans_font = 'Yanone Kaffeesatz', sans-serif
body
  font: 12px Helvetica, Arial, sans-serif;
  background: url('/images/paper_texture.png')
.container
  margin-top 60px


So everything is nice and similar. Love that.