Created
September 28, 2015 00:33
-
-
Save mattn/41d93589fbdd432c5321 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
package main | |
import ( | |
"github.com/gsp-lang/stdlib/fmt" | |
"github.com/gsp-lang/gsp/core" | |
"github.com/gsp-lang/stdlib/prelude" | |
"github.com/gsp-lang/stdlib/net/http" | |
) | |
func hello(w, r core.Any) core.Any { | |
fmt.Fprintf(w, "hello") | |
return nil | |
} | |
func main() { | |
http.HandleFunc("/", hello) | |
http.ListenAndServe(":9090", nil) | |
} | |
var _ = prelude.Len |
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
; Copy into example.gsp | |
(ns main | |
"/fmt" | |
"/net/http") | |
(def hello (fn [w r] | |
(fmt/fprintf w "hello") | |
())) | |
(def main (fn [] | |
(http/handle-func "/" hello) | |
(http/listen-and-serve ":9090" nil))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment