diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-04-25 16:16:51 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-04-25 16:16:51 +0200 |
commit | 468e33e7926897756acfe0d483633fb36949ebc5 (patch) | |
tree | b0bc6f5a62532028d6f2eb4616d16fb23ea6db04 /A useful Go oneliner to run a fileserver.md | |
parent | c9a730e5b363a10639309c81dab838232ee434b6 (diff) | |
parent | 80325cced8485df9d87c1b5d9f5d123d85b01336 (diff) |
vault backup: 2025-04-25 16:16:51
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(`.`)))' +``` |