Created
December 30, 2018 00:11
-
-
Save scorredoira/076c10e3fdc11469f3c5665986376d69 to your computer and use it in GitHub Desktop.
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
import "stdlib/native"; | |
function main() { | |
let s = http.newServer(); | |
s.address = ":8081"; | |
s.handler = zipHandler | |
s.start(); | |
} | |
function zipHandler(w: http.Response, r: http.Request) { | |
let zw = zip.newWriter(w); | |
let f = zw.create("test.txt") | |
f.write("lalala") | |
f = zw.create("readme.md") | |
f.write("hello") | |
zw.close() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment