Last active
October 5, 2015 09:39
-
-
Save ihower/e66f664b9f4925fb6754 to your computer and use it in GitHub Desktop.
This file contains 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
// golang 1.5.1 | |
// go run hello.go | |
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
) | |
func rootHandler(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprint(w, "Hello, world!") | |
} | |
func main() { | |
http.HandleFunc("/", rootHandler) | |
log.Fatal(http.ListenAndServe(":9090", nil)) | |
} | |
// node 4.1.1 | |
// node hello.js | |
var ip = "127.0.0.1"; | |
var port = 1337; | |
var http = require('http'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Hello World\n'); | |
}).listen(port, ip); | |
// ruby 2.2.3, rack 1.6.4, passenger 5.0.20 | |
// passenger start | |
run Proc.new { |env| ['200', {'Content-Type' => 'text/plain'}, ["Hello World\n"]] } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment