esh / latte

lightweight javascript mvc framework
http://www.lattejs.com
Other
23 stars 3 forks source link

Introduction

This project started life when I decided to learn javascript after reading Steve Yegge's post on Rhino on Rails. Rather then wait for Steve to release RoR (he still hasn't) I decided to write a very simplified version myself.

Latte is a serverside JavaScript MVC framework powered by Rhino. I use latte to power http://www.edomame.com, my personal website.

Features

Dependencies

Building the framework

  1. clone the repository from github!
  2. shell into the root directory
  3. latte> ant

So simple

  1. latte/app/controller> cat hello.js (function() { return { world: function() { return ["ok", "hello world"] }, world2: function() { return ["ok", render("view/hello/world2.jhtml", { text: "hello world2" })] } } })
  2. latte> ./latte.sh init.js
  3. check out http://localhost:8080/hello/world in a browser
  4. and http://localhost:8080/hello/world2

A more complicated website

Check out the code at http://www.github.com/esh/edomame to see a full webapp built on latte. It has url rewriting, database access, a REST api, automatic redeployment via github pushes, and many more goodies.