1.0.1 • Published 6 years ago

parse-axios-rest-api v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

parse-rest-api

Axios wrapper for working with parse server

Why use this?

If you love Axios and you work with parse server rest api then is perfect for you, this is only wrapper to axios with methods by the parse rest api guide

How to get started

  1. install npm package: npm install parse-rest-api --save
  2. import to your project : import api from 'parse-rest-api'
  3. init the api with parse server configuration: api.init({ appId: 'MY_APP_ID', // required baseURL: 'https://MY_PARSE_SERVER_LOCATION/parse' // required masterKey: 'MY_MASTER_KEY' // optional sessionToken: 'XXXX' // optional })
  4. you can set sessionToken by run the setSessionToken method: api.setSessionToken('-s ddd3434dDD')
  5. you can remove sessionToken by run the removeSessionToken method api.removeSessionToken()

These are just defaults. Feel free to swap out eslint for jshint, or tape for mocha, or whatever you use for CI instead of coveralls.

Example

  • query api.query(className, query, limit, skip, Count = true, keys, include, order)

api.query('POST, {title: 'dd'}, 4, true, 'title,body,image', image, '-createdAt') .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });