mirror of
https://github.com/rclone/rclone.git
synced 2025-08-09 05:54:43 +02:00
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:
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))
|
||||
}
|
Reference in New Issue
Block a user