transloadit / uppy

The next open source file uploader for web browsers :dog:

Home Page:https://uppy.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduce @uppy/server-functions

Murderlon opened this issue · comments

Initial checklist

  • I understand this is a feature request and questions should be posted in the Community Forum
  • I searched issues and couldn’t find anything (or linked relevant results below)

Problem

We strongly discourage using Companion just for S3 signing if aren't using Companion already. But when you need to implement it for you own backend, we require an embarrassing amount of almost 600 lines of complex code (client, server).

This issue is particularly about the server-side code.

Solution

Introduce @uppy/server-functions which exports functions for the S3 logic to be used inside a route handler. This would significantly reduce the burden to introduce S3 in your own backend with Uppy.

In the future I can imagine more things in this package for @uppy/xhr-upload. Things like server-side validation similar to UploadThing and generating a Transloadit signature.

Alternatives

Export a router which can be integrated in any Node.js framework. Take a look at how tus-node-server does this for inspiration.