forked from koding/koding
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.coffee
More file actions
executable file
·31 lines (28 loc) · 861 Bytes
/
Copy pathserver.coffee
File metadata and controls
executable file
·31 lines (28 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
###
Node server
###
http = require 'http'
fs = require 'fs'
server = http.createServer (req, res) ->
if req.url is '/'
res.writeHead 200,
'Content-Type' : 'text/html'
res.end fs.readFileSync __dirname + '/index.html'
else if req.url is '/underscore.js'
res.writeHead 200,
'Content-Type' : 'text/html'
res.end fs.readFileSync __dirname + '/underscore.js'
else if req.url is '/jspath.js'
res.writeHead 200,
'Content-Type' : 'text/html'
res.end fs.readFileSync __dirname + '/jspath.js'
else if req.url is '/mongoop.js'
res.writeHead 200,
'Content-Type' : 'text/html'
res.end fs.readFileSync __dirname + '/../index.js'
else if req.url is '/index.coffee'
res.writeHead 200,
'Content-Type' : 'text/html'
res.end fs.readFileSync __dirname + '/index.coffee'
return
server.listen 1337