├── .gitignore ├── LICENSE ├── README.md ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # node-waf configuration 21 | .lock-wscript 22 | 23 | # Compiled binary addons (http://nodejs.org/api/addons.html) 24 | build/Release 25 | 26 | # Dependency directory 27 | node_modules 28 | 29 | # Optional npm cache directory 30 | .npm 31 | 32 | # Optional REPL history 33 | .node_repl_history 34 | 35 | # C++ 36 | browse.VC.db -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Felix Rieseberg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Parse-Server-Azure 2 | npm version dependencies Adapters, tools, and documentation to use Parse-Server with Microsoft Azure, brought to you by your friends at Microsoft. 3 | 4 | > :memo: Find detailed instructions in the [Wiki](https://github.com/felixrieseberg/parse-server-azure/wiki)! 5 | 6 | ``` 7 | npm install parse-server-azure 8 | ``` 9 | 10 | If you're using `parse-server` at version 2.2 (or below), please install with: 11 | 12 | ``` 13 | npm install parse-server-azure@0.1.2 14 | ``` 15 | 16 | ## General Usage 17 | 18 | ```js 19 | ... 20 | var ParseServerAzure = require('parse-server-azure'); 21 | var api = new ParseServer({ 22 | ... 23 | filesAdapter: new ParseServerAzure.FilesAdapter(account, container, filesOptions), 24 | pushAdapter: new ParseServerAzure.PushAdapter(pushOptions) 25 | ... 26 | }); 27 | ... 28 | ``` 29 | 30 | ## FilesAdapter 31 | By default, Parse-Server uses the `GridStoreAdapter` to store files, meaning that files will be stored in the connected database. For better performance, you can store files in Azure Blob Storage, using this module's `FilesAdapter`. 32 | 33 | ```js 34 | var ParseServer = require('parse-server').ParseServer; 35 | var AzureStorageAdapter = require('parse-server-azure').FilesAdapter; 36 | 37 | var account = 'YOUR_AZURE_STORAGE_ACCOUNT_NAME'; 38 | var container = 'YOUR_AZURE_STORAGE_CONTAINER_NAME'; 39 | var options = { 40 | accessKey: 'YOUR_ACCESS_KEY', 41 | directAccess: false // If set to true, files will be served by Azure Blob Storage directly 42 | } 43 | 44 | var api = new ParseServer({ 45 | appId: process.env.APP_ID || 'myAppId', 46 | serverURL: process.env.SERVER_URL || 'http://localhost:1337' 47 | (...) 48 | filesAdapter: new AzureStorageAdapter(account, container, options); 49 | }); 50 | ``` 51 | 52 | #### Direct Access 53 | By default, Parse will proxy all files - meaning that your end user accesses the files via your open source Parse-Server, not directly by going to Azure Blob storage. This is useful if you want files to only be accessible for logged in users or have otherwise security considerations. 54 | 55 | If your files can be public, you'll win performance by accessing files directly on Azure Blob Storage. To enable, ensure that your container's security policy is set to `blob`. Then, in your adapter options, set `directAccess: true`. 56 | 57 | ## PushAdapter 58 | 59 | Find the most up to date documentation at the repository: 60 | https://github.com/mamaso/parse-server-azure-push 61 | 62 | ## License 63 | The MIT License (MIT); Copyright (c) 2016 Microsoft Corporation. Please see `LICENSE` for details. 64 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const FilesAdapter = require('parse-server-azure-storage').AzureStorageAdapter; 4 | const PushAdapter = require('parse-server-azure-push'); 5 | 6 | module.exports = { 7 | FilesAdapter, 8 | PushAdapter 9 | } 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "parse-server-azure", 3 | "version": "1.1.0", 4 | "description": "Adapters, tools, and documentation to use Parse-Server with Microsoft Azure", 5 | "main": "index.js", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/felixrieseberg/parse-server-azure.git" 9 | }, 10 | "keywords": [ 11 | "Azure", 12 | "Parse", 13 | "Parse-Server", 14 | "Microsoft" 15 | ], 16 | "author": "Felix Rieseberg", 17 | "license": "MIT", 18 | "bugs": { 19 | "url": "https://github.com/felixrieseberg/parse-server-azure/issues" 20 | }, 21 | "homepage": "https://github.com/felixrieseberg/parse-server-azure#readme", 22 | "dependencies": { 23 | "parse-server-azure-storage": "^1.0.1", 24 | "parse-server-azure-push": "^1.0.2" 25 | }, 26 | "engines": { 27 | "node": ">=4.3" 28 | } 29 | } 30 | --------------------------------------------------------------------------------