Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 53 lines (36 sloc) 1.498 kb
ae35225 @ggoodman Reorganized code into separate servers for landing page, plunk server…
authored
1 coffee = require("coffee-script")
03c38f1 @ggoodman Basic functionality
authored
2 express = require("express")
a4f182b @ggoodman Minor page speed optimizations
authored
3 gzippo = require("gzippo")
646b784 @ggoodman Reorganize code for connect-assets
authored
4 assets = require("connect-assets")
120f73e @ggoodman AAARGHx2
authored
5 sharejs = require("share")
03c38f1 @ggoodman Basic functionality
authored
6
7 app = module.exports = express.createServer()
ae35225 @ggoodman Reorganized code into separate servers for landing page, plunk server…
authored
8
254c4e4 @ggoodman "Rework card views to support reload and visual cues"
authored
9 app.use assets()
2a86e7a @ggoodman "Refreshing mostly works"
authored
10 app.use gzippo.staticGzip("#{__dirname}/public")
12f64ba @ggoodman "Remove streaming asset compressor"
authored
11 #app.use gzippo.compress() # To be put back in when it has better caching support
2db42e3 @ggoodman WIP: Syncing of buffer list and state done. TODO: buffer contents
authored
12 app.use express.static("#{__dirname}/public")
2a86e7a @ggoodman "Refreshing mostly works"
authored
13
37a2f61 @ggoodman Editor working in a basic state
authored
14 app.use "/api/v1", require("./servers/api/v1")
2a86e7a @ggoodman "Refreshing mostly works"
authored
15 app.use "/raw", require("./servers/plunks")
16
e2ca259 @ggoodman Query parameter to go straight to live panel
authored
17 app.set "views", "#{__dirname}/views"
18 app.set "view engine", "jade"
19 app.set "view options", layout: false
7ebb35e @ggoodman WIP
authored
20
f17598d @ggoodman Memory-based store to simplify things
authored
21
e73e2f7 @ggoodman Major look and feel overhaul
authored
22 app.get "/", (req, res) ->
23 res.render("index", page: "/")
24
25 app.get "/documentation", (req, res) ->
26 res.render("documentation", page: "/documentation")
27
dec3b41 @ggoodman "Add about section"
authored
28 app.get "/about", (req, res) ->
29 res.render("about", page: "/about")
30
e73e2f7 @ggoodman Major look and feel overhaul
authored
31
7bbc835 @ggoodman WIP on real-time collaborative editing
authored
32 # Start the sharejs server before variable routes
33 sharejs.server.attach app,
f59ed0e @ggoodman Fixes to stream-related logic
authored
34 db:
35 type: "none"
36
7bbc835 @ggoodman WIP on real-time collaborative editing
authored
37
2a86e7a @ggoodman "Refreshing mostly works"
authored
38 app.get /^\/([a-zA-Z0-9]{6})\/(.*)$/, (req, res) ->
39 res.local "raw_url", "/raw" + req.url
40 res.local "plunk_id", req.params[0]
41 res.render "preview"
42
43 app.get /^\/([a-zA-Z0-9]{6})$/, (req, res) -> res.redirect("/#{req.params[0]}/", 301)
44
45
e2ca259 @ggoodman Query parameter to go straight to live panel
authored
46 app.get /^\/edit(?:\/([a-zA-Z0-9]{6})\/?)?/, (req, res) ->
37a2f61 @ggoodman Editor working in a basic state
authored
47 res.render("editor", page: "/edit", views: req.param("views", "sidebar editor preview").split(/[ \.,]/).join(" "))
f17598d @ggoodman Memory-based store to simplify things
authored
48
0b8a720 @ggoodman WIP: Streaming working! now for cosmetics
authored
49 app.use express.logger()
66b37dd @ggoodman Created landing page in glorious Bootstrap 2.0
authored
50
ae35225 @ggoodman Reorganized code into separate servers for landing page, plunk server…
authored
51 if require.main == module
52 app.listen process.env.PORT || 8080
b79d19e @ggoodman "Corrected debug statement that somehow vanished"
authored
53 console.log "Listening on port %d", process.env.PORT || 8080
Something went wrong with that request. Please try again.