Merge pull request #26 from sumnerboy12/patch-1

add support for rest server backends
This commit is contained in:
Nicco 2020-07-23 13:29:20 +02:00 committed by GitHub
commit e7be01da37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -48,4 +48,15 @@ backends:
path: my-host:/remote/path/on/the/server
```
## Rest Server
See [here](https://github.com/restic/rest-server) for how to install a rest server backend and [here](https://restic.readthedocs.io/en/latest/030_preparing_a_new_repo.html#rest-server) for further documentation.
```yaml
backends:
name-of-backend:
type: rest
path: http://localhost:8000/repo_name
```
> :ToCPrevNext

View File

@ -17,9 +17,8 @@ export const getPathFromBackend = (backend: Backend): string => {
case 'gs':
case 's3':
case 'sftp':
return `${backend.type}:${backend.path}`
case 'rest':
throw new Error(`Unsupported backend type: "${backend.type}"`)
return `${backend.type}:${backend.path}`
default:
throw new Error(`Unknown backend type.`)
}