Giter VIP home page Giter VIP logo

017-rails-projects's Introduction

README

Build a basic contact management system implemented as an API that follows the JSON API spec Keywords: Rails, API, JSONAPI, JSONAPI::Resources

How to run it:

  1. Clone repo: ~$ git clone https://github.com/ddeveloperr/017-rails-projects.git

  2. ~$ cd /017-rails-projects

  3. ~$ bundle

  4. ~$ rails server

  5. query all of our contacts using postman, curl or other api tools:

    Try with curl:

    curl -i -H "Accept: application/vnd.api+json" "http://localhost:3000/contacts"
    
    

    You should get the following results in the terminal:

    HTTP/1.1 200 OK
    X-Frame-Options: SAMEORIGIN
    X-XSS-Protection: 1; mode=block
    X-Content-Type-Options: nosniff
    X-Download-Options: noopen
    X-Permitted-Cross-Domain-Policies: none
    Referrer-Policy: strict-origin-when-cross-origin
    Content-Type: application/vnd.api+json
    ETag: W/"b912b40771e870b364b3ff27bcc0276a"
    Cache-Control: max-age=0, private, must-revalidate
    X-Request-Id: b4c78d3e-a109-44bf-a6ce-37d96dd21f72
    X-Runtime: 0.016046
    Transfer-Encoding: chunked
    
    

    Over browser: http://localhost:3000/contacts

    You should see:

              {
              "id": "1",
              "type": "contacts",
              "links": {
              "self": "http://localhost:3000/contacts/1"
              },
              "attributes": {
              "name-first": "John",
              "name-last": "Doe",
              "email": "[email protected]",
              "twitter": null
              },
              "relationships": {
              "phone-numbers": {
              "links": {
              "self": "http://localhost:3000/contacts/1/relationships/phone-numbers",
              "related": "http://localhost:3000/contacts/1/phone-numbers"
              }
            }
           }
          }
        ]
     }
    

017-rails-projects's People

Contributors

ddeveloperr avatar

Stargazers

 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.