Coder Social home page Coder Social logo

spree_api_extend's Introduction

SpreeApiExtend

A couple quick additional methods on the api to better support JS MVC frontends.

  • Create users (don't have to be an admin) @ /api/users. Returns api key in response
  • Login users via POST /api/sessions w/ json: "{ session: {email: "email", password: "password"}}"". returns api key in response.
  • Get current order & user @ "/api/status"
  • get /api/orders w/ a logged in 'non-admin' user will return all orders belonging to that user.

CAUTION

These modifications are changing the default spree authorization for the api that could introduce security issues. Be sure you look through the changes before you do anything productiony!

Installation

Add spree_api_extend to your Gemfile:

gem 'spree_api_extend'

Bundle your dependencies and run the installation generator:

bundle
bundle exec rails g spree_api_extend:install

Testing

Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.

bundle
bundle exec rake test_app
bundle exec rspec spec

When testing your applications integration with this extension you may use it's factories. Simply add this require statement to your spec_helper:

require 'spree_api_extend/factories'

Copyright (c) 2013 Drew Purdy, released under the New BSD License

spree_api_extend's People

Contributors

andrewmp1 avatar

Watchers

 avatar  avatar

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.