0.1.59 • Published 10 years ago

asset-server-client v0.1.59

Weekly downloads
39
License
-
Repository
-
Last release
10 years ago

Asset-server-client

Client module for asset-server (https://github.com/aprnd/asset-server)

Requirements

  • Node.JS >= 0.10.21

Installing/testing

  • Install asset-server
  • Run npm install after getting asset-server-client
  • Go to test/
  • Assuming your server is running locally, you can create a bucket with:
    $ node createbucket.js local.asset-server.com 5604 "Testing bucket" testerbucket SomeReallyPrivateBucketCreationKey
    ------
    Creating bucket Testing bucket
    ------
    STATUS: 200
    HEADERS: {"content-type":"application/json","content-length":"159","date":"Sat, 22 Mar 2014 16:52:38 GMT","connection":"keep-alive"}
    SUCCESS creating bucket testerbucket (named SomeReallyPrivateBucketCreationKey) on local.asset-server.com:5604
    BODY: {"subdomain":"testerbucket","name":"Testing bucket","apiKey":"66a26c035f773c3b63c4206faf484b94337f2c79","apiSecret":"f6475557309a0e3ffc320f2e13a8a82f6a0e3df8"}
  • It should return an api key and a secret that you can use to access your new bucket like so:
    $ node put.js local.asset-server.com 5604 testerbucket 66a26c035f773c3b63c4206faf484b94337f2c79 f6475557309a0e3ffc320f2e13a8a82f6a0e3df8 napoleon.jpg /test/napoleon.jpg image/jpg
    ------
    Testing PUT upload of napoleon.jpg (of type image/jpg) to testerbucket.local.asset-server.com:5604/test/napoleon.jpg
    ------
    { key: '/test/napoleon.jpg',
      passedHeaders: { 'Content-Type': 'image/jpg', 'Content-Length': 19397 },
      headers: 
       { Date: 1395507882053,
         'Content-Length': 19397,
         'Content-Type': 'image/jpg',
         Authorization: 'Basic QVdTIDY2YTI2YzAzNWY3NzNjM2I2M2M0MjA2ZmFmNDg0Yjk0MzM3ZjJjNzk6NWU1MzFmMjVjNDY0MTJhMDFhMWQ2NjRjODVjNDVjYTZmOTQ5Zjc4OA==' },
      httpVerb: 'PUT',
      opts: 
       { domain: 'local.asset-server.com',
         port: '5604',
         bucket: 'testerbucket',
         apiKey: '66a26c035f773c3b63c4206faf484b94337f2c79',
         apiSecret: 'f6475557309a0e3ffc320f2e13a8a82f6a0e3df8',
         host: 'testerbucket.local.asset-server.com',
         socketTimeout: 10000,
         expiryMinutes: 10 },
      
      [ ... ]

      headers: 
       { 'x-amz-version-id': '51f7ea03dfd0611115a8aad88c8130c4',
         date: 'Sat, 22 Mar 2014 16:54:42 GMT',
         connection: 'keep-alive',
         'transfer-encoding': 'chunked' },

      [ ... ]

      SUCCESS PUT testerbucket.local.asset-server.com:5604/test/napoleon.jpg
0.1.59

10 years ago

0.1.58

10 years ago

0.1.57

10 years ago

0.1.56

10 years ago

0.1.55

10 years ago

0.1.54

10 years ago

0.1.53

10 years ago

0.1.52

10 years ago

0.1.51

10 years ago

0.1.5

10 years ago

0.1.46

10 years ago

0.1.45

10 years ago