diff options
-rw-r--r-- | .obsidian/workspace.json | 6 | ||||
-rw-r--r-- | A useful Go oneliner to run a fileserver.md | 11 |
2 files changed, 14 insertions, 3 deletions
diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 0f430c1..201a685 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -173,13 +173,14 @@ "obsidian-excalidraw-plugin:New drawing": false } }, - "active": "f1111e0bbe22e125", + "active": "84e32b3623ed3a00", "lastOpenFiles": [ + "A useful Go oneliner to run a fileserver.md", + "weekly/2025 W16.md", "daily/10-Apr-2025.md", "A reason for becoming senior is that when Rutger is off I take most of his responsibilities.md", "daily/11-Apr-2025.md", "daily/18-Apr-2025.md", - "weekly/2025 W16.md", "daily/16-Apr-2025.md", "daily/17-Apr-2025.md", "daily/14-Apr-2025.md", @@ -203,7 +204,6 @@ "Using Libvirt to manage QEMU image bitmaps.md", "Updating the image os admin user to fix password resets.md", "The volume type of a Cinder volume can be changed.md", - "Testing Golang programs.md", "ESP", "Excalidraw" ] 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(`.`)))' +``` |