-
-
Save intel352/8059344 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
import 'dart:html' show Console; | |
void main() { | |
var console = new Console(); | |
console.log("ok ab dart!"); | |
} | |
// to compile use: | |
// dart2js -oab.js ab.dart |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>okaq.com</title> | |
<script src="/js/ab.js"></script> | |
</head> | |
<body> | |
</body> | |
</html> |
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
// webserver.go | |
package main | |
import ( | |
"fmt" | |
"net/http" | |
// "net/url" | |
) | |
func AbHandler(w http.ResponseWriter, r *http.Request) { | |
fmt.Println(r.URL.Path) | |
if r.URL.Path == "/" { | |
http.ServeFile(w, r, "ab.html") | |
} | |
if r.URL.Path == "/js/ab.js" { | |
http.ServeFile(w, r, "ab.js") | |
} | |
} | |
func main() { | |
http.HandleFunc("/", AbHandler) | |
http.ListenAndServe(":8000", nil) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment