Created
November 13, 2011 03:24
-
-
Save vvakame/1361538 to your computer and use it in GitHub Desktop.
most simple Node.js+CoffeeScript at Heroku
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('coffee-script') | |
http = require('http') | |
port = process.env.PORT or 8080 | |
hostAddress = "0.0.0.0" | |
if(port == 8080) | |
hostAddress = "127.0.0.1" | |
http.createServer (req, res) -> | |
res.writeHead 200, 'Content-Type': 'text/plain' | |
res.end 'Hello World from CoffeeScript\n' | |
.listen port, hostAddress | |
console.log 'Server running at http://%s:%d/', hostAddress, port |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name":"hoge", | |
"version":"0.0.1", | |
"private":true, | |
"scripts":{ | |
"start":"coffee app.coffee" | |
}, | |
"dependencies":{ | |
"coffee-script":">=1.1.3", | |
"socket.io":">=0.8.7" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: coffee app.coffee |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment