Skip to content
Myr

app.js

This file

Path

examples/app.js

38 lines · 584 bytes · JavaScript

Last changed by

When Accept includes text/html display exceptions otherwise 500visionmediabefore adoptionbd4f150

History of this file

Take it

The walk stopped after 200 commits: lines older than 06c0b42 point at it.

Added mime() specsvisionmediabefore adoption06c0b42

line 1why, one step back
1

Cleaning up example appvisionmediabefore adoption05e9cc6

line 2why, one step back
2require.paths.unshift('lib')

Added mime() specsvisionmediabefore adoption06c0b42

line 3why, one step back
3require('express')

Added plugins.js for quick plugin mixinsvisionmediabefore adoption39b0e43

line 4why, one step back
4require('express/plugins')

Added mime() specsvisionmediabefore adoption06c0b42

line 5why, one step back
5

Defaulting views to <root>/viewsvisionmediabefore adoption84a7c51

line 6why, one step back
6configure(function(){

When Accept includes text/html display exceptions otherwise 500visionmediabefore adoptionbd4f150

line 7why, one step back
7 use(CommonLogger)

Cleaning up example appvisionmediabefore adoption05e9cc6

lines 8–9why, one step back
8 use(MethodOverride)
9 use(ContentLength)

Defaulting views to <root>/viewsvisionmediabefore adoption84a7c51

lines 10–13why, one step back
10 set('root', dirname(__filename))
11 enable('cache views')12})13

Added chat example (though not practical over http)visionmediabefore adoption9c5552c

lines 14–15why, one step back
14var messages = []
15

Started chat examplevisionmediabefore adoption654c526

line 16why, one step back
16get('/chat', function(){

Added chat example (though not practical over http)visionmediabefore adoption9c5552c

lines 17–21why, one step back
17 render('chat.haml.html', {
18 locals: {19 messages: messages20 }21 })

Cleaning up example appvisionmediabefore adoption05e9cc6

line 22why, one step back
22})

Added mime() specsvisionmediabefore adoption06c0b42

line 23why, one step back
23

Added chat example (though not practical over http)visionmediabefore adoption9c5552c

lines 24–30why, one step back
24post('/chat', function(){
25 messages.push(param('message'))26 halt(200)27})2829get('/chat/messages', function(){30 contentType('json')

Added aliases of JSON.encode() and JSON.decode()visionmediabefore adoption0d9f502

line 31why, one step back
31 return JSON.encode(messages)

Added mime() specsvisionmediabefore adoption06c0b42

lines 32–33why, one step back
32})
33

Started show exceptions supportvisionmediabefore adoptione728d3c

lines 34–37why, one step back
34get('/error', function(){
35 throw new Error('oh noes!')36})37

Added mime() specsvisionmediabefore adoption06c0b42

line 38why, one step back
38run()