summaryrefslogtreecommitdiff
path: root/A useful Go oneliner to run a fileserver.md
diff options
context:
space:
mode:
Diffstat (limited to 'A useful Go oneliner to run a fileserver.md')
-rw-r--r--A useful Go oneliner to run a fileserver.md11
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(`.`)))'
+```