adonis-parse-sdk
JavaScript Parse SDK wrapper for Adonis JS
Install
npm install adonis-parse-sdk --save
Usage
Create a file in app/config/parseSdk.js
and paste the code below by replacing it's values where necessary:
'use strict' /* |-------------------------------------------------------------------------- | Parse Configuration |-------------------------------------------------------------------------- | | Here we define the configuration for the parse server. | */ moduleexports = /* |-------------------------------------------------------------------------- | Parse Application ID |-------------------------------------------------------------------------- | | Define the same application ID as the one specified in the parse server | appId: 'Your-parse-app-ID', */ appId: null /* |-------------------------------------------------------------------------- | Parse Javascript key |-------------------------------------------------------------------------- | javaScriptKey: 'Your-parse-javaScript-key' */ javaScriptKey: null /* |-------------------------------------------------------------------------- | Parse Javascript key |-------------------------------------------------------------------------- | masterKey: 'Your-parse-master-key', */ masterKey: null /* |-------------------------------------------------------------------------- | Parse Server URL |-------------------------------------------------------------------------- | | Define the parse URL: e.g. https://domain.com:4040/parse | serverUrl: 'Your-parse-server-URL', | */ serverUrl: null
Also you need to add the provider to AdonisJS at app/bootstrap/app.js
:
const providers = ... 'adonis-parse-sdk/providers/ParseProvider'
then you can simply call it from within controllers etc:
const Parse =
[Example] User SignUp and SignIn
Add to one of your controllers. e.g. LoginController:
'use strict'const Parse = * { // Sign UP var user = ; user; user; user; user; } * { /* Sign In */ ParseUser; }