mirror of
https://github.com/restic/rest-server.git
synced 2025-12-07 09:36:13 -08:00
read support for length and offset
This commit is contained in:
24
server.go
24
server.go
@@ -1,10 +1,28 @@
|
||||
package main
|
||||
|
||||
import ()
|
||||
import (
|
||||
//"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
//path, _ := ioutil.TempDir("", "restic-repository-")
|
||||
//log.Printf("initialize context at %s", path)
|
||||
|
||||
//http.ListenAndServe(":8000", r)
|
||||
context := Context{"/tmp/restic"}
|
||||
|
||||
repo, _ := context.Repository("repo")
|
||||
repo.Init()
|
||||
|
||||
errc := context.Init()
|
||||
if errc != nil {
|
||||
log.Println("context initialization failed")
|
||||
return
|
||||
}
|
||||
|
||||
router := Router{context}
|
||||
port := ":8000"
|
||||
log.Printf("start server on port %s", port)
|
||||
http.ListenAndServe(port, router)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user