Notify President Madagascar
    Wondering what’s next for npm?Check out our public roadmap! »

    @forefront/parse-server-cos-adapter

    1.1.0 • Public • Published

    parse-server-cos-adapter

    Tecent Cloud COS(file storage) adapter for parse-server

    Greenkeeper badge BuildStatus codecov.io NPM Version semantic-release

    parse-server adapter for Tecent COS

    installation

    npm install --save @forefront/parse-server-cos-adapter

    usage with parse-server

    using a config file

    {
      "appId": 'my_app_id',
      "masterKey": 'my_master_key',
      // other options
      "filesAdapter": {
        "module": "@forefront/parse-server-cos-adapter",
        "options": {
          "SecretId": "SecretId",
          "SecretKey": "SecretKey",
          "Region": "my_region",
          "Bucket": "my_bucket",
          "Signed": false // default value
          // optional:
          "directAccess": false // default value
        }
      }
    }
    

    using environment variables

    Set your environment variables:

    COS_SECRET_ID=SecretId
    COS_SECRET_KEY=SecretKey
    COS_REGION=regionName
    COS_BUCKET=bucketName
    COS_SIGNED=false
    COS_DIRECT_ACCESS=false
    

    And update your config / options

    {
      "appId": 'my_app_id',
      "masterKey": 'my_master_key',
      // other options
      "filesAdapter": "@forefront/parse-server-cos-adapter"
    }
    

    passing as an instance

    var COSAdapter = require('@forefront/parse-server-cos-adapter');
    
    var cosAdapter = new COSAdapter(
      'SecretId',
      'SecretKey',
      'Region',
      'Bucket',
      false,
      {
        directAccess: false
      }
    );
    
    var api = new ParseServer({
      appId: 'my_app',
      masterKey: 'master_key',
      filesAdapter: cosAdapter
    })
    

    or with an options hash

    var COSAdapter = require('@forefront/parse-server-cos-adapter');
    
    var cosOptions = {
      "SecretId": "SecretId",
      "SecretKey": "SecretKey",
      "Region": "my_region",
      "Bucket": "my_bucket",
      "Signed": false,
      "DirectAccess": false
    }
    
    var cosAdapter = new COSAdapter(cosOptions);
    
    var api = new ParseServer({
      appId: 'my_app',
      masterKey: 'master_key',
      filesAdapter: cosAdapter
    })
    

    Install

    npm i @forefront/parse-server-cos-adapter

    DownloadsWeekly Downloads

    5

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    13.3 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar