File: web_server.coffee

package info (click to toggle)
coffeescript 1.10.0~dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,292 kB
  • sloc: makefile: 62
file content (12 lines) | stat: -rw-r--r-- 274 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
# Contributed by Jason Huggins

http = require 'http'

server = http.createServer (req, res) ->
  res.writeHeader 200, 'Content-Type': 'text/plain'
  res.write 'Hello, World!'
  res.end()

server.listen PORT = 3000

console.log "Server running at http://localhost:#{PORT}/"