feathers-mongoose-casl
Version 2.1.2
Version 2.1.2
  • feathers-mongoose-casl
  • Docs
    • Migrating
    • START A NEW PROJECT
      • Generate a new project.
      • install feathers-mongoose-casl
      • feathers-logger
      • Update config
      • Add mongoose
      • Email service
      • App hooks
      • Import required services
      • Verify user and filter user fields
      • Swagger, Logger, BodyParser
      • Email templates
      • public HTML
      • Run the server
      • Create you first user
      • vs code snippet extension
      • Test Login
      • Dashboard
      • Create a new Service with casl&Dashboard
      • Posts Postman snippet
      • Add Admin role
      • Done!
    • Advanced
      • Security - eslint-plugin-security
      • Security - rate limiting
      • Development tools
    • Guides
      • Throw errors
      • Auth Flow
      • Authentication
      • Authouriztion
      • /me
      • Rules Cache
      • Create a new service
      • Custom service validtor client data
      • validators
        • Example of use
        • Types
        • Mongoose schema
      • Default value
      • $Populate
      • Upload service
      • Upload files
        • Create upload service
        • Sign File After Populate
        • Storage support
          • Google-cloud
      • Error
      • feathers Client examples
      • Dashboard
        • Dashboard Config
          • Field configuration
          • doc Layout
          • custom Fields
            • customElements
        • Online dashboard
        • Add to your react app
      • customized feathers-mongoose-casl/services
      • Redis - in progress
      • S3
      • Postman
      • Swagger
      • debug
    • Production
      • ENV
    • Feathers wiki
      • Good links
    • utils
      • send email example
      • Async For Each
      • Create heroku server
      • pick
      • vs code snippet extension
      • Persist user request
    • Ecosystem
    • TODO
    • Versions updates
Powered by GitBook
On this page

Was this helpful?

  1. Docs
  2. Guides

S3

PreviousRedis - in progressNextPostman

Last updated 6 years ago

Was this helpful?

1 - Create s3 bucket

Follow this useful guide

2- Update config file

/config/default.json

Copy this yo your client app-

const axios = require("axios");
const app = feathers();
const restClient = rest("http://localhost:3030");
app.configure(restClient.axios(axios));

// Available options are listed in the "Options" section
app.configure(
  auth({
    header: "Authorization", // the default authorization header for REST
    prefix: "", // if set will add a prefix to the header value. for example if prefix was 'JWT' then the header would be 'Authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOi...'
    path: "/authentication", // the server-side authentication service path
    jwtStrategy: "jwt", // the name of the JWT authentication strategy
    entity: "user", // the entity you are authenticating (ie. a users)
    service: "users", // the service to look up the entity
    cookie: "feathers-jwt", // the name of the cookie to parse the JWT from when cookies are enabled server side
    storageKey: "feathers-jwt", // the key to store the accessToken in localstorage or AsyncStorage on React Native
    storage: cookieStorage // Passing a WebStorage-compatible object to enable automatic storage on the client.
  })
);
  
  //Upload to S3
  const upload = (acceptedFiles, rejectedFiles) => {
    var formData = new FormData();
    formData.append("file", acceptedFiles[0], "chris.jpg");
    app
      .service("uploads")
      .create(formData, {
        headers: {
          "content-type": "multipart/form-data"
        }
      })
      .then(res => {
        alert("upload ends");
      })
      .catch(err => {
        alert(err.message);
      });
  };
  
  //Upload to local
  const upload = (acceptedFiles, rejectedFiles) => {
    var formData = new FormData();
    formData.append("file", acceptedFiles[0], "chris.jpg");
    app
      .service("uploads-static")
      .create(formData, {
        headers: {
          "content-type": "multipart/form-data"
        }
      })
      .then(res => {
        alert("upload ends");
      })
      .catch(err => {
        alert(err.message);
      });
  };

How to upload file with

feathers client
https://github.com/keithweaver/python-aws-s3​