Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
the-teacher committed Jul 3, 2012
0 parents commit c49a07b
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
13 changes: 13 additions & 0 deletions Cakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fs = require 'fs'
{print} = require 'sys'
{spawn, exec} = require 'child_process'
coffee_path = './node_modules/coffee-script/bin/coffee'

task 'compile_coffee_files', 'Compile CoffeeScript source files', ->
app_path = __dirname
src_path = "#{__dirname}/app_src"

app_coffee = spawn coffee_path, ['-cbw', '-o', app_root, "#{__dirname}/app_src"]
app_coffee.stdout.on 'data', (data) -> print data.toString()
app_coffee.stderr.on 'data', (data) -> print data.toString()
app_coffee.on 'exit', (status) -> callback?() if status is 0
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sass --watch input-dir:output-dir
34 changes: 34 additions & 0 deletions app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions app_src/app.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
express = require 'express'
routes = require './routes'
http = require 'http'
app = express()

app.configure ->
app.set 'port', process.env.PORT || 3000
app.set 'views', __dirname + '/views'
app.set 'view engine', 'jade'
app.use express.favicon()
app.use express.logger 'dev'
app.use express.bodyParser()
app.use express.methodOverride()
app.use app.router
app.use express.static(__dirname + '/public')

app.configure 'development', ->
app.use express.errorHandler()

app.get '/', routes.index

server = http.createServer(app)

server.listen app.get('port'), ->
console.log "Express server listening on port " + app.get('port')
2 changes: 2 additions & 0 deletions app_src/routes/index.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exports.index = (req, res) ->
res.render 'index', { title: 'Express' }
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "application-name",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "3.0.0beta5",
"jade": "*",
"coffee-script": "*",
"the_time.js": "*"
}
}
8 changes: 8 additions & 0 deletions public/stylesheets/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
body {
padding: 50px;
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
}

a {
color: #00B7FF;
}
7 changes: 7 additions & 0 deletions routes/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions views/index.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
extends layout

block content
h1= title
p Welcome to #{title}
7 changes: 7 additions & 0 deletions views/layout.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
doctype 5
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content

0 comments on commit c49a07b

Please sign in to comment.