Giter Club home page Giter Club logo

reststop2's Introduction

reststop2


This package is deprecated. I will fix bugs, but will neither add new features nor ensure future Meteor compatibility. Everything that this package is capable of can now be accomplished using iron-router server-side routes and core Meteor packages (for example accounts-password).

In fact, some folks seem to have done just that with this restivus package. It shares all the features of reststop2, with a similar API and planned support for Meteor 0.9.0+. Check it out!

Thanks for using reststop2.


RESTstop makes it easy to serve RESTful APIs from Meteor.

See full documentation.

reststop2's People

Contributors

bitdeli-chef avatar hellogerard avatar kahmali avatar paolo avatar sclausen avatar shrop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reststop2's Issues

request params use associative arrays instead of objects

when trying to access the params from a request, I was attempting to simply use this.params as a parameter for Collection.insert().

  // POST /projects
  RESTstop.add('projects', {method: 'POST'}, function () {
    return Projects.insert(this.params);
  });

This is currently failing since this.params is an associative array, initializing params as an object fixes this particular issue. Any reason to use an associative array?

Raw Post Data

I'm trying to connect my Meteor app to a 3rd party which authenticates by sending the username & password in a XML format in the raw post data.

But i can't seem to access it, any clue how to?

realtime live data using rest?

Does your rest plugin supported live data?
I have tried this reststop, but i can't access my data realtime like usual meteor.
How to get realtime data? thanks

just add content-type if none present

The content-type is forced so if you set the content-type, including charset, it would be overwritten.

A simple check if the content-type is set would prevent this.

Signup call for account creation

Hi,
Is there any default function created for signups just like there is for login.
For example having something like curl --data "password=pwd&user=this_user&fullname=Myname" http://localhost:3000/api/signup/

Thanks

login with reststop2

can you tell me how to login with reststop2?

use_auth
Default: false
If true, /login and /logout routes are added. You can also access this.user, which will be false if not logged in.

i still don't understand how to login with reststop2,
I think the /login and /logout are "added" automatically when use_auth is true. but i still don't understand how to use it, because always fails.
like this?

localhost:3000/api/login

can someone give me an example? i ask on stack overflow, but no one response.

how to send data from client with json?

first thanks for you hard work,
finally i can understand and use reststop2 for some project.
but i need something more secure than send data from parameter,
can i create additional header or something like send application/json frombody?

bcrypt login problem

As you know Meteor 0.8.2 using bcrypt. In my project when I try to login with reststop2, it has return {"success": false, "message": "User has no password set"} because reststop2 control SRP password field.

What should I do?

So thanx.

Add support for pluggable authentication

Currently reststop only supports native Meteor authentication (using Accounts and Meteor.users). It would be great to add support for authentication callbacks (login/logout/verify) to support other authentication mechanisms (eg. LDAP).

BTW, thanks for this awesome package!

Allow app and package to depend on reststop2

If an app depends on reststop2 and a package in the app depends on reststop2, you get an error: Error: RESTstop.configure() has to be called before first call to RESTstop.add().

RESTstop.apply don’t work

I try to use RESTstop.apply:

RESTstop.add('todos', {require_login: true, method: 'POST'}, function() {
    return RESTstop.apply(this, 'add', this.params);
});

And receive this error:

❯ curl  -H "X-Login-Token: umyndTx9XYQJ3yGZL" -H "X-User-Id: 8Mvsq8MZwR5zmt5pw"  --data "title=NewToDo" -X POST http://localhost:3000/api/todos/
{"success":false,"message":"undefined is not a function"}

As far as I can debug it Meteor._MethodInvocation is undefined.

Meteor 0.6.6.1, Reststop2 0.5.2.

Request Entity Too Large

I just got this when posting an encoded-image as json:
It works with small images. Maybe there is a limit that has to be set?

W20140321-09:31:39.332(1)? (STDERR) Error: Request Entity Too Large
W20140321-09:31:39.334(1)? (STDERR) at Object.exports.error (/Users/anton/.meteorite/packages/reststop2/BeDifferential/reststop2/48cf04921f0d66e5834382bf5a769b8cc995b396/.build/npm/node_modules/connect/lib/utils.js:62:13)
W20140321-09:31:39.334(1)? (STDERR) at limit (/Users/anton/.meteorite/packages/reststop2/BeDifferential/reststop2/48cf04921f0d66e5834382bf5a769b8cc995b396/.build/npm/node_modules/connect/lib/middleware/limit.js:46:47)
W20140321-09:31:39.334(1)? (STDERR) at json (/Users/anton/.meteorite/packages/reststop2/BeDifferential/reststop2/48cf04921f0d66e5834382bf5a769b8cc995b396/.build/npm/node_modules/connect/lib/middleware/json.js:52:5)
W20140321-09:31:39.335(1)? (STDERR) at Object.bodyParser as handle
W20140321-09:31:39.335(1)? (STDERR) at next (/Users/anton/.meteorite/meteors/meteor/meteor/4555d2c8e4f7389d9d5fadd39d381fdb080ed742/packages/webapp/.build/npm/node_modules/connect/lib/proto.js:190:15)
W20140321-09:31:39.336(1)? (STDERR) at Object.query as handle
W20140321-09:31:39.336(1)? (STDERR) at next (/Users/anton/.meteorite/meteors/meteor/meteor/4555d2c8e4f7389d9d5fadd39d381fdb080ed742/packages/webapp/.build/npm/node_modules/connect/lib/proto.js:190:15)
W20140321-09:31:39.336(1)? (STDERR) at Function.app.handle (/Users/anton/.meteorite/meteors/meteor/meteor/4555d2c8e4f7389d9d5fadd39d381fdb080ed742/packages/webapp/.build/npm/node_modules/connect/lib/proto.js:198:3)
W20140321-09:31:39.337(1)? (STDERR) at Object.fn as handle
W20140321-09:31:39.337(1)? (STDERR) at next (/Users/anton/.meteorite/meteors/meteor/meteor/4555d2c8e4f7389d9d5fadd39d381fdb080ed742/packages/webapp/.build/npm/node_modules/connect/lib/proto.js:190:15)

http.js:733
throw new Error('Can't render headers after they are sent to the client.'
^
Error: Can't render headers after they are sent to the client.
at ServerResponse.OutgoingMessage._renderHeaders (http.js:733:11)
at ServerResponse.writeHead (http.js:1150:20)
at ProxyServer. (/Users/anton/.meteorite/meteors/meteor/meteor/4555d2c8e4f7389d9d5fadd39d381fdb080ed742/tools/run-proxy.js:85:21)
at ProxyServer.emit (/Users/anton/.meteorite/meteors/meteor/meteor/4555d2c8e4f7389d9d5fadd39d381fdb080ed742/dev_bundle/lib/node_modules/http-proxy/node_modules/eventemitter3/index.js:78:10)
at ClientRequest. (/Users/anton/.meteorite/meteors/meteor/meteor/4555d2c8e4f7389d9d5fadd39d381fdb080ed742/dev_bundle/lib/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:113:16)
at ClientRequest.EventEmitter.emit (events.js:117:20)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.EventEmitter.emit (events.js:95:17)
at onwriteError (_stream_writable.js:235:10)
at onwrite (_stream_writable.js:253:5)
at WritableState.onwrite (_stream_writable.js:97:5)
at fireErrorCallbacks (net.js:438:13)
at Socket._destroy (net.js:472:3)
at Object.afterWrite (net.js:718:10)

Sending File

Can I send a file through REST API using reststop2?

I'm trying to send file with memberId like this: curl -X POST -H "Cache-Control:no-cache" -H "Postman-Token:3018218b-5014-ecee-de81-57f01ffa8c3f" -H "Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryp7MA4YWxkTrZu0gW" -F "memberId=iZjWKQLE6PvJst6ad" -F "picture=297048_full.jpg" http://localhost:3000/api/members/setPicture

But when I do console.log(this.params) the data accepted just memberId.

How the proper way to send a file to the API?

* not working for catch-all route

The docs state: "If someone accesses an undefined route, by default a 404 and {success: false, message: "API method not found"}. You can overide this by using * as your route, which acts as a catch-all."

I am trying this kind of thing:

RESTstop.add('*', function() {
return [404, { success: false, message: 'API method not found', documentation_url: 'https://api.github.org' }];
});

But, I get this instead of my modified catch-all message:

TypeError: Object # has no method 'push'
at RESTstop.Route.match (packages/reststop2/routing.js:72)
at _RESTstop.match (packages/reststop2/server.js:45)
at packages/reststop2/server.js:136

Any ideas on what may be doing wrong?

Thanks!
shrop

Readable JSON

I am working on getting an API going for my app and have managed to get an endpoint successfully returning JSON. The problem is, it appears to be serialized—all the line breaks and newlines have been stripped from it. Is there a way to get it to output more-readable JSON?

Unexpected error.

Using reststop2 to get all my contents collection, but get 'Unexpected error.' message.

RESTstop.add('contents', {require_login: false}, function(){
  var contents = [];

  Contents.find({}).forEach(function(content){
    contents.push(content);
  });

  console.log(contents);
  return contents;
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.