Skip to content

Latest commit

 

History

History
72 lines (45 loc) · 1.13 KB

README.md

File metadata and controls

72 lines (45 loc) · 1.13 KB

jsonAPI RESTful: A demo of JSONAPI-Resources

This app is a tiny RESTful system implemented as an API that follows the JSON API spec, with this API you can scraping a given website through its url.

Steps to run this app

Clone the app

git clone [email protected]:jorge627/jsonapi-restful.git

Enter to the project

cd jsonapi-restful

Run bundle

bundle install

Create the databases

rake db:create

Migrate the database

rake db:migrate

Run the server

rails s

Test the API with CURL

You can add new record like this

curl -i -H "Accept: application/vnd.api+json" -H 'Content-Type:application/vnd.api+json' -X POST -d '{"data": {"type":"pages", "attributes":{"url":"http://www.google.com"}}}' http://localhost:3000/pages

Then you can list all urls saved and its content

curl -i -H "Accept: application/vnd.api+json" -H 'Content-Type:application/vnd.api+json' http://localhost:3000/pages

Things you may want to cover:

  • Ruby version
2.3.1
  • How to run the test suite
bundle exec rspec