GithubHelp home page GithubHelp logo

asset-uploader's Introduction

Preliminary instructions

Run npm install

Create a env.js file.

  • make sure AWS credentials file is properly updated in .aws, with Key, Secret Key, etc.
  • update serverless.yml with whatever standards you choose (region, etc.)

sls deploy to whatever stage you like

#retrieve the Root url for each endpoint after deploy. This will consist of the 'root url', appended with either /asset or /asset/{some_informaion}. Update env.js similar to the following example (with your own root):

create a bucket on the Amazon developer console

  • You must explicitly enable versioning on your bucket. By default, versioning is disabled.
  • update serverless file bucket name accordingly
  • update the env.js file accordingly

INTERFACE

creating a signed url to upload assets, and how to use the url

The service will have a POST endpoint to upload a new asset.

  • POST @ 'ApiGatewayRootUrl' + '/asset', Body: empty
  • Sample response will look like: { “upload_url”: , “id”: }
  • The user will now be able to make a PUT call to the s3 signed url to upload the asset
  • PLEASE NOTE: files must be uploaded using a PUT to the specified url, and not a POST.
  • If a POST is truly desired, please see handler.js for an available endpoint.

asset-uploader's People

Watchers

Andrea Ellison 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.