diff options
author | Jasper Ras <jaspert.ras@gmail.com> | 2025-04-18 21:24:18 +0200 |
---|---|---|
committer | Jasper Ras <jaspert.ras@gmail.com> | 2025-04-18 21:24:18 +0200 |
commit | 80325cced8485df9d87c1b5d9f5d123d85b01336 (patch) | |
tree | fa33c6c01f818533c6d5aa5e7a930160294e5f2f /A useful Go oneliner to run a fileserver.md | |
parent | a00113edd596f0bad40269573999abd844ca82b5 (diff) |
vault backup: 2025-04-18 21:24:18
Diffstat (limited to 'A useful Go oneliner to run a fileserver.md')
-rw-r--r-- | A useful Go oneliner to run a fileserver.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/A useful Go oneliner to run a fileserver.md b/A useful Go oneliner to run a fileserver.md new file mode 100644 index 0000000..97037da --- /dev/null +++ b/A useful Go oneliner to run a fileserver.md @@ -0,0 +1,11 @@ +--- +tags: + - golang + - howto +--- +Multiple times I wish I had remembered this one-liner, now I come across it again whilst reading about Golang/WASM. So that's where it was from! Here it is: + +```sh +# install goexec: go install github.com/shurcooL/goexec@latest +goexec 'http.ListenAndServe(`:8080`, http.FileServer(http.Dir(`.`)))' +``` |