Yet Another Simple JSON-API Indexer
This file is intended to explain the use of this Simple HTML Indexer
## Requisites:
-
Ruby 2.4.2
-
Rails 4.2.10
-
JSOAPI-response 0.9
## Installation: After you git clone the repo, follow the next steps on yout terminal or console:</b>
-
bundle install (install all required gems)
-
open database.yml and change you local mysql password
-
rake db:setup (to create empty database structure)
-
rake db:migrate (to update database schema)
-
rails server
The API is built under the next namespace
“‘ localhost:3000/api/v1/ “`
## Usage:
Show all the URLS in the database and the relationships “‘ localhost:3000/api/urls “`
Show data from a specific entry “‘ localhost:3000/api/urls/1 “`
Show the related items for a specific URL “‘ localhost:3000/api/v1/urls/1?include=h1s,h2s,h3s,links “`
## Saving Data Passing the URL as part of the JSON String will create an entry into the Urls table.
Example:
“‘ curl -i -H “Accept: application/vnd.api+json” -H ’Content-Type:application/vnd.api+json’ -X POST -d ‘{“data”: {“type”:“urls”, “attributes”:{“url”:“www.microsoft.com”}}}’ 0.0.0.0:3001/api/v1/urls “‘
H1,H2,H3 and Links parsing (Work in progress)