GithubHelp home page GithubHelp logo

yshing / angular-filemanager-nodejs-bridge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fkoester/angular-filemanager-nodejs-bridge

0.0 2.0 0.0 27 KB

A bridge for angular-filemanager using Node.js and Express

License: GNU Affero General Public License v3.0

JavaScript 100.00%

angular-filemanager-nodejs-bridge's Introduction

angular-filemanager-nodejs-bridge

This project provides a backend for the fantastic angular-filemanager UI written with Node.js and Express.

CAUTION: This project is a work in progress!

Features

Currently the following operations are (partially) implemented:

TODO

Usage (standalone)

  1. Checkout this Git repository:
git clone https://github.com/fkoester/angular-filemanager-nodejs-bridge.git
  1. Install dependencies:
npm install
  1. run
DATA_DIR=/tmp npm start

Change DATA_DIR variable to the root folder you want angular-filemanager to operate on 4. Configure angular-filemanager in your angular app:

app.config(function (fileManagerConfigProvider) {
  var defaults = fileManagerConfigProvider.$get();

  fileManagerConfigProvider.set({
    copyUrl: '{/files}/copy', // where {/files} is the mount path of this module.
    createFolderUrl: '{/files}/createFolder',
    downloadFileUrl: '{/files}/download',
    editUrl: '{/files}/edit',
    removeUrl: '{/files}/remove',
    renameUrl: '{/files}/rename',
    uploadUrl: '{/files}/upload',
    getContentUrl: '{/files}/getContent',
    listUrl: '{/files}/list',
  });
});

Using Docker

You can also run this server via Docker using the image maestroalubia/angular-filemanager-nodejs-bridge.

The easiest way to get it up running is using docker-compose, just run docker-compose up in the project root. This exports the host's /tmp directory. You can change this by changing the docker-compose.yml file.

Usage (in other express application)

If you want to integrate this bridge into your own Express application you can do so by adding it as a dependency:

  1. Install via npm

    npm install --save angular-filemanager-nodejs-bridge
    
  2. Import and configure the router

    const express = require('express');
    const filesRouter = require('angular-filemanager-nodejs-bridge').router;
    const routes = express.Router();
    
    routes.use('/files', filesRouter);
    
  3. Configure a custom base dir function (optional)

const pathresolver = require('angular-filemanager-nodejs-bridge').pathresolver;

pathresolver.baseDir = function(req) {

  if(req.body.username = 'foo') {
    return '/foo';
  }

  return '/bar';
};

angular-filemanager-nodejs-bridge's People

Contributors

fkoester avatar yshing avatar

Watchers

 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.