Giter Site home page Giter Site logo

marketplaceapi's Introduction

Projeto MarketPlace API

Projeto é uma API com os aspectos principais de um marketplace!

========================================

  • As ferramentas utilizadas nesse projeto:
 Rails 5
  gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
  gem 'pg', '~> 0.18'
  gem 'puma', '~> 3.0'

  gem 'rack-cors', :require => 'rack/cors'

  group :development, :test do
    # Call 'byebug' anywhere in the code to stop execution and get a debugger console
    gem 'byebug', platform: :mri
   gem 'factory_girl_rails'
   gem 'ffaker'
  end

  group :test do
   gem 'rspec-rails'
   gem 'shoulda-matchers'
   gem 'email_spec'
  end

  gem 'active_model_serializers', '~> 0.10.0'
  gem 'devise'
  gem 'kaminari'
  gem 'delayed_job_active_record'


 Docker

  • Comandos Docker

  • Stop container

      docker-compose stop $(docker ps -qf)
    
    
  • To remove all containers that are NOT running

      docker rm `docker ps -aq -f status=exited`
    
    
  • To list all running and stopped containers

      docker ps -a
    
    
  • To list all running containers (just stating the obvious and also example use of -f filtering option)

    
      docker ps -a -f status=running
    
    
  • To list all running and stopped containers, showing only their container id

    
      docker ps -aq
    
    
  • List all name of all containers

    
      docker inspect --format='{{.Name}}' $(sudo docker ps -aq --no-trunc)
    
    
  • Remove all images pendente

      docker rmi $(docker images -f dangling=true -q)
    
    
  • One liner to stop / remove all of Docker containers:

        docker stop $(docker ps -a -q)
        docker rm $(docker ps -a -q)
    
  • Verificando se está funcionando api

    curl -H 'Accept: application/vnd.marketplace.v1' http://api.market_place_api.dev/users/1
    
  • Caso peça permissão de pasta basta colocar o comando no terminal

    sudo chown -R $USER:$USER .
    
  • Configurar o active_model_serializers

    And configure Rails for JSON API serialization in two steps:
    
      Create an initializer at config/initializers/json_api.rb with the following code:
    
      ActiveSupport.on_load(:action_controller) do
      require 'active_model_serializers/register_jsonapi_renderer'
      end
    
      ActiveModelSerializers.config.adapter = :json_api
      ```
    
    
    
    
  • Capítulo 7 error

      /config/initializers/serializer.rb
      ActiveModelSerializers.config.adapter = :json_api # Default: `:attributes`
      By default ActiveModelSerializers will use the Attributes Adapter (no JSON root). But we strongly advise you to use JsonApi Adapter, which follows 1.0 of the format specified in jsonapi.org/format.
    
    
      https://github.com/rails-api/active_model_serializers/blob/master/docs/general/adapters.md#advanced-adapter-configuration
    

Desenvolvendo APIS ON RAILS

================================

APIonRails-IcaliaLabs

O tutorial é muito bom, mas como já foi feita à tempo, tive que refazer algumas alterações para o modelo atual do framework Rails 5 --api e das gems!

marketplaceapi's People

Contributors

rodolfopeixoto avatar

Watchers

 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.