Nuwe Parse Server - Javascript SDK Getting Started


#1

In order to get up and running with the iOS SDK for the Parse-Server Service (see Feature: Nuwe Parse-Server for how to quickly setup Parse Server for your Nuwe app), here’s a quickstart guide (thanks to the team at Parse).

##Install

Option 1:

Download the Javascript/HTML5 Project

Option 2:

Include the hosted library in your code via javascript include

<script type="text/javascript" src="http://www.parsecdn.com/js/parse-latest.js"></script>

Option 3:

Install via NPM

$ npm install parse

In a browser based application, include as normal:

var Parse = require('parse');

If you’re building a server side node.js application or command line tool

var Parse = require('parse/node');

And if it’s a react-native application:

var Parse = require('parse/react-native');

Connect to your Nuwe Parse-Server

Place this script tag into your page or into a separate javascript file and include it into your project

<script type="text/javascript">
    Parse.initialize("APPLICATION_ID", "JAVASCRIPT_KEY_UNUSED");
    Parse.serverURL = 'https://parse.nuwe.co:<YOUR_PORT>/parse';
<script>

Test the SDK

Add this after your initialization call:

var TestObject = Parse.Object.extend("TestObject");
var testObject = new TestObject();
testObject.save({foo: "bar"}).then(function(object) {
  alert("yay! it worked");
});

Run your app and then review your parse dashboard locally, you should see a new TestObject class and the row that you just created!