Skip to content

purai/rails_api

Repository files navigation

Wercker AUR

Rails PurAí API

App build in Rails that provides an RESTful API. It covers endpoints to add, edit and delete events.

This project package the following functions:

  • Events
  • Categories
  • Sale Places
  • User
  • Login

Installation

Get via git clone:

$ git clone https://github.com/purai/rails_api.git
$ cd rails_api

Get dependencies:

$ bundle install

Usage

Run the migration. This command will execute the migration that is stored in the db/migrate/ directory and have not yet been executed in the database

$ rake db:migrate

Content from file db/seeds.rb will add some sample records. So run it to insert those values

$ rake db:seed

Then start the server with rails s -p 3001

server

And the application will start at http://localhost:3001

Endpoint

GET http://localhost:3001/api/v1/events

POST http://localhost:3001/api/v1/events

PUT http://localhost:3001/api/v1/events/{id}

DELETE http://localhost:3001/api/v1/events/{id}

Event data object example

{ 
    "event":
    {
        "title": "",
        "body": ""
    }
}

License

This project is licensed under the GNU GPLv3 License - see the LICENSE file for details

Made with ❤️ by Felipe Mendes.