Code Monkey home page Code Monkey logo

file-server-api's Introduction

file-server-api

Basic file server with API routes for CRUD.

Authorization for either simple admin api keys/passwords (giving unlimited permissions for state-changing interactions like creating new folders, or uploading files), or more complex account setups with individual ranks and permissions with user data stored in MongoDB. Unauthorized users will still be a able to view and download the files.

All file paths used in requests are relative to root path in config.yaml, i.e., /server/files/image.jpg not /home/deafnv/server/files/image.jpg.

This file server is used in the demo in this repository.

Usage

Warning

Place an empty index.ts file in ./src/routes/custom before starting.

Clone, setup config.yaml, run npm install, npm run build, and npm start. See config-template.yaml for details on the config file format. The server should start by default on port 80, and 443 if configured with HTTPS.

If database is enabled and running for the first time, run npm run migrate to migrate the database schema.

Routes

All routes causing state changes in the server require authorization. See Authorization Routes for details.

file-server-api's People

Contributors

deafnv avatar

Watchers

 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.