All Projects → OpenMarshal → Npm Webdav Server

OpenMarshal / Npm Webdav Server

Licence: unlicense
WebDAV Server for npm

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Npm Webdav Server

Pronote Api
(Tout langage) API compatible Pronote 2020/2021
Stars: ✭ 186 (+34.78%)
Mutual labels:  server, npm
Wsgidav
A generic and extendable WebDAV server based on WSGI
Stars: ✭ 476 (+244.93%)
Mutual labels:  server, webdav
Omdb Graphql Wrapper
🚀 GraphQL wrapper for the OMDb API
Stars: ✭ 45 (-67.39%)
Mutual labels:  server, npm
Chainabstractionlayer
Blockchain abstraction layer
Stars: ✭ 131 (-5.07%)
Mutual labels:  npm
Spreadsheet server
A python server harnessing the calculational ability of LibreOffice Calc (thanks to 'pyoo'). It provides 'instant' access to the cell ranges of a set of spreadsheets.
Stars: ✭ 132 (-4.35%)
Mutual labels:  server
Hrconvert2
A self-hosted, drag-and-drop, & nosql file conversion server that supports 62x file formats.
Stars: ✭ 132 (-4.35%)
Mutual labels:  server
Go Xserver
Go 服务器框架(go-x.v2)
Stars: ✭ 137 (-0.72%)
Mutual labels:  server
Health
Laravel Health Panel
Stars: ✭ 1,774 (+1185.51%)
Mutual labels:  server
Sonic
🦔 Fast, lightweight & schema-less search backend. An alternative to Elasticsearch that runs on a few MBs of RAM.
Stars: ✭ 12,347 (+8847.1%)
Mutual labels:  server
See
Simple and fast web server
Stars: ✭ 135 (-2.17%)
Mutual labels:  server
Orderly
Ordered process (re)start, shutdown, and supervision.
Stars: ✭ 134 (-2.9%)
Mutual labels:  server
Jstp
Fast RPC for browser and Node.js based on TCP, WebSocket, and MDSF
Stars: ✭ 132 (-4.35%)
Mutual labels:  server
Whackage
Multi-repo development tooling for React Native
Stars: ✭ 134 (-2.9%)
Mutual labels:  npm
Tsparticles
tsParticles - Easily create highly customizable particles animations and use them as animated backgrounds for your website. Ready to use components available for React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Solid, Riot and Web Components.
Stars: ✭ 2,694 (+1852.17%)
Mutual labels:  npm
Webpack Guide
Webpack Handbook
Stars: ✭ 136 (-1.45%)
Mutual labels:  npm
Nestjs Rbac
Awesome RBAC for NestJs
Stars: ✭ 129 (-6.52%)
Mutual labels:  npm
Ohshitgit
⁉️Oh shit! A cli tool to help you unfuck your git mistakes
Stars: ✭ 135 (-2.17%)
Mutual labels:  npm
Luna
A highly scalable and efficient Runescape server. Targets revision #317
Stars: ✭ 133 (-3.62%)
Mutual labels:  server
Practical Server Side Swift
Vapor 4 code samples for the Practical Server Side Swift book
Stars: ✭ 133 (-3.62%)
Mutual labels:  server
Pesocket
A C# Network Library.
Stars: ✭ 134 (-2.9%)
Mutual labels:  server

WebDAV Server for npm

Build Status Code Climate Rate Dependencies Status License npm Version

Join the chat at https://gitter.im/npm-WebDAV-Server/Lobby Join the chat at https://gitter.im/npm-WebDAV-Server/help-v2 Join the chat at https://gitter.im/npm-WebDAV-Server/help-v1 Join the chat at https://gitter.im/npm-WebDAV-Server/file-systems

Description

This server can use physical resources (files and folders on a hard drive, for instance), virtual resources (in-memory files and folders), processed/computed resources (for instance a file which provide the content of a remote web page), customized resources (whatever you created, whatever you can imagine), and use all of them on the same server instance. And it's easy to integrate in your JavaScript code!

You can use it to provide human readable content, easily manageable thanks to the WebDAV clients, or use a temporary and virtual file system to share information between running programs, or store crypted documents while still being able to use them as if they were not crypted (take a look at cwdav), etc...

This is a fully configurable server. You can use you own user manager, your own resources, your own HTTP methods, your own way to save the state of the server, etc... Find more in the documentation.

Project information

Here are some project related links :

You can find a list of file systems here :

This project rely upon the RFC4918.

This is an active project. Do not hesitate to post an issue if you have an idea or if you encounter a problem.

The project comes with two versions : the obselete version 1 and the version 2. Prefer using the version 2. At the moment, for compatibility issues, to access the version you must use the v2 namespace.

Install

npm install webdav-server

Quick usage

Very simple usage :

// TypeScript
import { v2 as webdav } from 'webdav-server'
// JavaScript
const webdav = require('webdav-server').v2;

const server = new webdav.WebDAVServer({
    port: 1900
});

server.start(() => console.log('READY'));

With some logs :

// TypeScript
import { v2 as webdav } from 'webdav-server'
// JavaScript
const webdav = require('webdav-server').v2;

const server = new webdav.WebDAVServer({
    port: 1900
});

server.afterRequest((arg, next) => {
    // Display the method, the URI, the returned status code and the returned message
    console.log('>>', arg.request.method, arg.requested.uri, '>', arg.response.statusCode, arg.response.statusMessage);
    // If available, display the body of the response
    console.log(arg.responseBody);
    next();
});

server.start(() => console.log('READY'));

With a user manager, privilege manager and serialization (save/load the state of the server) :

// TypeScript
import { v2 as webdav } from 'webdav-server'
// JavaScript
const webdav = require('webdav-server').v2;

// User manager (tells who are the users)
const userManager = new webdav.SimpleUserManager();
const user = userManager.addUser('username', 'password', false);

// Privilege manager (tells which users can access which files/folders)
const privilegeManager = new webdav.SimplePathPrivilegeManager();
privilegeManager.setRights(user, '/', [ 'all' ]);

const server = new webdav.WebDAVServer({
    // HTTP Digest authentication with the realm 'Default realm'
    httpAuthentication: new webdav.HTTPDigestAuthentication(userManager, 'Default realm'),
    privilegeManager: privilegeManager,
    port: 2000, // Load the server on the port 2000 (if not specified, default is 1900)
    autoSave: { // Will automatically save the changes in the 'data.json' file
        treeFilePath: 'data.json'
    }
});

// Try to load the 'data.json' file
server.autoLoad((e) => {
    if(e)
    { // Couldn't load the 'data.json' (file is not accessible or it has invalid content)
        server.rootFileSystem().addSubTree(server.createExternalContext(), {
            'folder1': {                                // /folder1
                'file1.txt': webdav.ResourceType.File,  // /folder1/file1.txt
                'file2.txt': webdav.ResourceType.File   // /folder1/file2.txt
            },
            'file0.txt': webdav.ResourceType.File       // /file0.txt
        })
    }
    
    server.start(() => console.log('READY'));
})

Within Express :

// TypeScript
import { v2 as webdav } from 'webdav-server'
import * as express from 'express'
// JavaScript
const webdav = require('webdav-server').v2;
const express = require('express');

const server = new webdav.WebDAVServer();
const app = express();

// Mount the WebDAVServer instance
app.use(webdav.extensions.express('/my/sub/path', server));
app.listen(1901); // Start the Express server

More examples at the example page of the wiki.

More information/possibilities in the documentation.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].