Skip to content

Instantly share code, notes, and snippets.

@scorredoira
Created December 30, 2018 00:11
Show Gist options
  • Save scorredoira/076c10e3fdc11469f3c5665986376d69 to your computer and use it in GitHub Desktop.
Save scorredoira/076c10e3fdc11469f3c5665986376d69 to your computer and use it in GitHub Desktop.
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