2.7.1
If you are using RVM:
Installation
$ rvm install 2.7.1
Use Version
$ rvm use 2.7.1
$ gem install rails
$ cd xyz-books-api
xyz-books-api$ bundle install
# Create databases
xyz-books-api$ rails db:create
# Migration
xyz-books-api$ rails db:migrate
# Seeding
xyz-books-api$ rails db:seed
xyz-books-api$ rails s
Note: Open a new terminal tab
xyz-books-api$ cd xyz-books-frontend
xyz-books-api/xyz-books-frontend$ npm install
xyz-books-api/xyz-books-frontend$ npm run serve
After running both Rails and Vue.js server, you should be able to access the webpage via http://localhost:8080/. From the book view page, sometimes the book is not being loaded as sometimes the axios request is being blocked by the popup/ad blocker. If that ever happen, kindly disable the popup/ad blocker then reload the page.
This endpoint returns 200 with the book data for valid ISBN. Otherwise, it returns 400 with an error message.
http://127.0.0.1:3000/books/978-1-891830-85-3
{
"id": 1,
"title": "American Elf",
"isbn_13": "9781891830853",
"isbn_10": "1891830856",
"image_url": "doughnuts & Doom.png",
"edition": "Book 2",
"publication_year": 2004,
"price": "1000.0",
"publisher_id": 1,
"created_at": "2022-10-17T13:03:14.206Z",
"updated_at": "2022-10-17T13:03:14.206Z",
"publisher_name": "Paste Magazine",
"author_names": "Joel Hartse, Hannah P. Templer, Marguerite Z. Duras"
}
{
"error": "Invalid isbn"
}
This endpoint is used to convert ISBN-13 to ISBN-10 or vise-versa.
http://127.0.0.1:3000/books/convert_isbn
{
"isbn": "978-1-891830-85-3"
}
{
"isbn": "1891830856"
}
{
"error": "Invalid isbn"
}