js: add experimental interface for integrating rclone into browsers
This works by compiling rclone to wasm and exporting the RC api to javascript.
This commit is contained in:
parent
3a14b1d5a9
commit
aab9aa8a2e
8 changed files with 830 additions and 0 deletions
19
fs/rc/js/serve.go
Normal file
19
fs/rc/js/serve.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
//+build none
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"mime"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
mime.AddExtensionType(".wasm", "application/wasm")
|
||||
mime.AddExtensionType(".js", "application/javascript")
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("/", http.FileServer(http.Dir(".")))
|
||||
fmt.Printf("Serving on http://localhost:3000/\n")
|
||||
log.Fatal(http.ListenAndServe(":3000", mux))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue