- Ruby version : 2.6.5
- Rails version: 6.0.0
- SqLite3 Version: 1.4
- Configuration
-
Install Packages
bundle -
Database creation:
rake db:create -
Database initialization:
rake db:migrate
-
Accept: application/vnd.api+json
PARAMETER: weburl -> The website's url to parse
-
Curl
curl --location --request GET "http://localhost:3000/parse_website?weburl=https://hugotunius.se/" --header "Accept: application/vnd.api+json"} -
Ruby
require "uri"
require "net/http"
url = URI("http://localhost:3000/parse_website?weburl=https://hugotunius.se/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/vnd.api+json"
response = http.request(request)
puts response.read_body
- Accept: application/vnd.api+json
- Content-Type: application/vnd.api+json
- Curl
curl --location --request GET "http://localhost:3000/web-page" \
--header "Accept: application/vnd.api+json" \
--header "Content-Type: application/vnd.api+json"
- Ruby
require "uri"
require "net/http"
url = URI("http://localhost:3000/web-page")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/vnd.api+json"
request["Content-Type"] = "application/vnd.api+json"
response = http.request(request)
puts response.read_body
- Accept: application/vnd.api+json
- Content-Type: application/vnd.api+json
- Curl
curl --location --request GET "http://localhost:3000/web-page-detail" \
--header "Accept: application/vnd.api+json" \
--header "Content-Type: application/vnd.api+json"
- Ruby
require "uri"
require "net/http"
url = URI("http://localhost:3000/web-page-detail")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Accept"] = "application/vnd.api+json"
request["Content-Type"] = "application/vnd.api+json"
response = http.request(request)
puts response.read_body