Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rajikaimal/nodecloud-architecture

POC for NodeCloud with various design patterns - GSoC '17 :sunny:
https://github.com/rajikaimal/nodecloud-architecture

gsoc-2017 javascript nodecloud nodejs

Last synced: 10 days ago
JSON representation

POC for NodeCloud with various design patterns - GSoC '17 :sunny:

Awesome Lists containing this project

README

        

# nodecloud-architecture

[NodeCloud GSoC Blog](https://medium.com/nodecloud)

POC for NodeCloud using different design patterns

## Install

```
$ git clone https://github.com/rajikaimal/nodecloud-architecture
$ cd nodecloud-architecture
$ yarn install
```

```js
const nodeCloud = require('nodecloud');
const config = require('./config');

// AWS
const ncAWS = nodeCloud.getProvider('aws');
const awsStorage = ncAWS.storage({ key: config.aws.S3, service: 'S3' });

awsStorage.createStorage({ Bucket: 'MyBucket', Body: 'Hello !' })
.then(res => {
console.log(`All done ! ${res}`);
})
.catch(err => {
console.log(`Oops something happened ${err}`);
})

// Google cloud platform
const ncGoogle = nodeCloud.getProvider('google');
const googleStorage = ncGoogle.storage({ key: config.google.storage, service: 'Storage' });

googleStorage.createStorage({ projectId: 'grape-spaceship-123' })
googleStorage.createStorage({ Bucket: 'MyBucket' })
.then(res => {
console.log(`All done ! ${res}`);
})
.catch(err => {
console.log(`Oops something happened ${err}`);
})
```