Giter Site home page Giter Site logo

summit-files's Introduction

#Summit Files A file manager for Summit

##Installation

npm install --save summit-files

##Configuration A default configuration setup is located in ./lib/defaultConfig.js You can override any of these settings when starting Summit by passing them in in Summit's config. ex:

var app = Summit({ files: {
  files: { permissions: { 
    everyone: { read: true, write: true, create: true }
  } }
} });

##Usage Summit-files adds two new collections to Summit.

  • Folder
  • File

It also adds routes to create, edit, and retrieve folders and files

###Folder routes

GET /folders ()
GET /folder/:id ([includeParent])
POST /folder (name)
PUT /folder/:id ([name], [permissions])
DEL /folder/:id ([recursive])

###File routes

GET /file/:id ()
GET /file/view/:id ()
GET /file/download/:id ()
POST /file/:folder (file)
PUT /file/:id ([name], [permissions])
DEL /file/:id ()

Each route takes a parameter output to tell it whether to return a json object, or a html page using handlebars templating. If output=json the route will treturn the json object, otherwise the html page is returned.

##Permissions Folder and File permissions are module based. By default, there are no restrictions on the file system.

A prebuilt system based on owner/group/everyone categories is included also, and can be enabled by calling app.invoke(require('SummitFiles').OwnerGroupEveryone) after invoking SummitFiles itself. You can override the default configuration of the permissions settings the same as you can SummitFiles itself. The defualt configuration file is located at ./lib/permissions/ownerGroupEveryoneConfig.js.

###Folder Permissions read the user can read the contents of the folder

write the user can update the folder name and permissions object

create the user can add subfolders and files to the folder

###File Permissions read the user can read the file contents

write the user can update the file name and permissions object of the file

##Example Server There are two example file system servers included:

./examples/json is an ajax based server

./examples/html is a html page based server

To run the example servers, run the ./server.js file in the folders.

summit-files's People

Contributors

dhjohn0 avatar

Stargazers

Nicole Whitehead Johnson avatar

Watchers

Martin Murphy avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.