Git Product home page Git Product logo

fu's Introduction

fu

simple file upload as a service with nodejs.

What ?

fu is a simple file upload api server built with express and express-fileupload.

Why ?

This is nothing more than an experiment, in a multitude of experiments that'd follow, if I do my #100DaysOfCode challenge seriously :)

How ?

# With NPM
npm install
npm start

# With Yarn
yarn
yarn start

Usage

  • To upload a file hit the endpoint /file with a POST request of the form payload=filename.ext.
# example with curl
$ curl -F '[email protected]' -i http://localhost:3030/file

HTTP/1.1 200 OK
X-Powered-By: Express
Location: /file/file_DIBjE8qishKn.png
Content-Type: text/html; charset=utf-8
Content-Length: 7
ETag: W/"7-U6VofLJtxB8qtAM+l+E63v03QNY"
Date: Sun, 10 Jun 2018 18:14:15 GMT
Connection: keep-alive
  • We'll get the location in the response header as Location: /file/newFileName.ext.
  • To get the file back, do a GET request to /file of the form /file/newFileName.ext

Note: Take a look at config.js to see the defaults.

TODO

  • Make a better README
  • Write better code dummy! Write vanilla JS, so as to remove deps
  • Set file size limits
  • Make an init script
  • Make it more thumbor - like.
  • Use this as an excuse to do a docker tutorial.

Changelog

  • package.json has a start:cors field.
  • File size limit. Check config.js

fu's People

Contributors

aktsbot avatar

Stargazers

 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.