Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 40 lines (29 sloc) 1.203 kb
271a61e9 »
2011-09-01 create a HtmlView that show the result on HTML
1 express = require 'express'
2 app = express.createServer express.logger()
3 port = process.env.PORT || 3000
4
5 app.set 'views', "#{__dirname}/views"
0e8142bd »
2011-09-01 refactor: allow user start from a specific stage
6 app.set 'view options', layout: false
7
271a61e9 »
2011-09-01 create a HtmlView that show the result on HTML
8 app.use express.static("#{__dirname}/public")
0e8142bd »
2011-09-01 refactor: allow user start from a specific stage
9
10 app.get '/', (req, res) ->
ca67f0d6 »
2011-09-16 encoded profile in URL
11 tower = 'beginner'
12 level = '1'
13 res.render 'index.ejs', levelNumber: parseInt(level), epic: false, tower: tower
0e8142bd »
2011-09-01 refactor: allow user start from a specific stage
14
79927dc8 »
2011-09-01 add Javascript mode
15 app.get '/js', (req, res) ->
6ff60395 »
2011-09-14 fix bug in position directionOf
16 res.render 'index-js.ejs', levelNumber: 1, epic: false
79927dc8 »
2011-09-01 add Javascript mode
17
0e8142bd »
2011-09-01 refactor: allow user start from a specific stage
18 app.get /^\/([0-9]+)$/, (req, res) ->
6ff60395 »
2011-09-14 fix bug in position directionOf
19 res.render 'index.ejs', levelNumber: req.params[0], epic: false
0e8142bd »
2011-09-01 refactor: allow user start from a specific stage
20
79927dc8 »
2011-09-01 add Javascript mode
21 app.get /^\/js\/([0-9]+)$/, (req, res) ->
6ff60395 »
2011-09-14 fix bug in position directionOf
22 res.render 'index-js.ejs', levelNumber: req.params[0], epic: false
0699169d »
2011-09-02 improve scoring system
23
24 app.get '/epic', (req, res) ->
6ff60395 »
2011-09-14 fix bug in position directionOf
25 res.render 'index.ejs', epic: true, levelNumber: 1
0699169d »
2011-09-02 improve scoring system
26
27 app.get '/js/epic', (req, res) ->
6ff60395 »
2011-09-14 fix bug in position directionOf
28 res.render 'index-js.ejs', epic: true, levelNumber: 1
29
30 app.get '/tower/:tower/:level', (req, res) ->
ca67f0d6 »
2011-09-16 encoded profile in URL
31 tower = req.params.tower
32 level = req.params.level
33
34 if level == "epic"
35 res.render 'index.ejs', levelNumber: 1, epic: true, tower: tower
36 else
37 res.render 'index.ejs', levelNumber: parseInt(level), epic: false, tower: tower
0699169d »
2011-09-02 improve scoring system
38
271a61e9 »
2011-09-01 create a HtmlView that show the result on HTML
39 app.listen port, =>
40 console.log "Listen on #{port}"
Something went wrong with that request. Please try again.