Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

nukr/koa-parse-restapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koa-parse-restapi

To install simply run:

npm install koa-parse-restapi

Require koa first and will only work on node v0.11.7 or newer.

You must run node with --harmony flag (--harmony-generators works as well)

node --harmony example.js
var koa = require('koa');
var Parse = require('koa-parse-restapi');
var meepbee = new Parse('application_id', 'rest_api_key');

var app = koa();

app.use(function *() {

    var products = yield meepbee.classes('Products').getAll();
    console.log(JSON.parse(products.body));

    var users = yield meepbee.users().getAll();
    console.log(JSON.parse(users.body));

    var comments = yield meepbee.classes('Comments').getAll('?include=commenter');
    console.log(JSON.parse(comments.body));



    this.body = products;
});

app.listen(process.env.PORT || 8080);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published