mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-07 05:38:30 +02:00
Added doc generator
- Added plugin doc generator - Added getting start plugin doc
This commit is contained in:
38
docs/plugins/main.go
Normal file
38
docs/plugins/main.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type FileInfo struct {
|
||||
Filename string `json:"filename"`
|
||||
Title string `json:"title"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
/* Change this before deploying */
|
||||
var (
|
||||
mode = flag.String("m", "web", "Mode to run the application: 'web' or 'build'")
|
||||
root_url = flag.String("root", "/html/", "Root URL for the web server")
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
flag.Parse()
|
||||
|
||||
switch *mode {
|
||||
case "build":
|
||||
build()
|
||||
default:
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.FileServer(http.Dir("./")).ServeHTTP(w, r)
|
||||
})
|
||||
fmt.Println("Starting server at :8080")
|
||||
if err := http.ListenAndServe(":8080", nil); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user