コードを借りる

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: file:///srv/svn/repo/aya/trunk@73 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
yakumo.izuru
2023-10-23 22:39:52 +00:00
parent f5ad132d67
commit 34cc1312ba
2 changed files with 40 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
// $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v 1.0 2023-10-03 02:34:17, yakumo_izuru Exp $
// $TheSupernovaDuo: marisa.chaotic.ninja/aya/cmd/aya, v0.6.4 2023-10-23 22:26:23, yakumo_izuru Exp $
package main
import (
@@ -6,7 +6,6 @@ import (
"fmt"
"io"
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
@@ -369,14 +368,6 @@ func buildAll(watch bool) {
}
}
// Serve the public directory over HTTP
func serve() {
root := http.Dir(PUBDIR)
http.Handle("/", http.FileServer(root))
log.Printf("Serving the %s directory over http://localhost:8000. Interrupt with ^C.\n", PUBDIR)
log.Fatal(http.ListenAndServe(":8000", nil))
}
// Initialize the environment
func init() {
// prepend .aya to $PATH, so plugins will be found before OS commands
@@ -422,7 +413,7 @@ func main() {
case "help":
printUsage()
case "serve":
serve()
aya.HttpServe(PUBDIR)
case "var":
if len(args) == 0 {
log.Fatal("var: filename expected")