Giter Site home page Giter Site logo

jrest's Introduction

#JRest

Estrutura básica para início rápido de aplicações rest usando SLIM Framework.

##Instalação

Depois de instalar o Composer, execute este comando a partir do diretório no qual você deseja instalar sua aplicação.

composer create-project jrest/jrest --stability=dev [my-app-name]

Substitua [my-app-name] com o nome do diretório desejado para o novo aplicativo. Você vai querer:

##Exemplos RESTful

####exemplo de listagem GET: http://localhost/jrest/app/public/teste

HEADER: Authorization: 123456

####exemplo de visualizacao GET: http://localhost/jrest/app/public/teste/view/1

HEADER: Authorization: 123456

####exemplo de adicionar POST: http://localhost/jrest/app/public/teste/add

HEADER: Authorization: 123456

    {"test_name":"Jorge Jardim", "test_email":"[email protected]"}

####exemplo de editar PUT: http://localhost/jrest/app/public/teste/edit

HEADER: Authorization: 123456

    {"test_id":1, "test_name":"Jorge F Jardim", "test_email":"[email protected]"}

####exemplo de deletear DELETE: http://localhost/jrest/app/public/teste/delete/1

HEADER: Authorization: 123456

####exemplo de login POST: http://localhost/jrest/app/public/login

    {"email":"[email protected]","password":"senha"}

##Banco de Dados

    CREATE TABLE IF NOT EXISTS `tests` (
      `test_id` int(10) NOT NULL AUTO_INCREMENT,
      `test_name` varchar(255) COLLATE utf8_bin NOT NULL,
      `test_email` varchar(255) COLLATE utf8_bin NOT NULL,
      PRIMARY KEY (`test_id`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;

    CREATE TABLE IF NOT EXISTS `users` (
      `user_id` int(10) NOT NULL AUTO_INCREMENT,
      `user_name` varchar(100) COLLATE utf8_bin NOT NULL,
      `user_email` varchar(100) COLLATE utf8_bin NOT NULL,
      `user_password` varchar(64) COLLATE utf8_bin NOT NULL,
      `user_token` varchar(64) COLLATE utf8_bin NOT NULL,
      `created` datetime NOT NULL,
      `modified` datetime NOT NULL,
      PRIMARY KEY (`user_id`)
    ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_bin ;

##Autor

Jorge Jardim [http://www.jorgejardim.com.br/]

jrest's People

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.