@webdav-server/github
v1.0.1
Published
GitHub file system for webdav-server
Downloads
25
Maintainers
Readme
GitHub File System for webdav-server
webdav-server version 2
Allow to see the list of files/directories in a GitHub repository. It is read-only.
Install
npm install @webdav-server/github
Usage
// TypeScript
import { v2 as webdav } from 'webdav-server'
import * as github from '@webdav-server/github'
// JavaScript
const webdav = require('webdav-server').v2;
const github = require('@webdav-server/github');
const server = new webdav.WebDAVServer({
// [...]
autoLoad: {
// [...]
serializers: [
new github.GitHubSerializer()
// [...]
]
}
})
// for client_id and client_secret, refer to https://developer.github.com/v3/oauth_authorizations/
server.setFileSystemSync('/myPath', new github.GitHubFileSystem('openmarshal', 'npm-WebDAV-Server', 'client_id...', 'client_secret...'), false);
server.start((s) => console.log('Ready on port', s.address().port));