- Ruby version: 2.7.2
- Configuration.
- Execute
bundle install
- configure gem figaro.
- create config/application.yml
- append .gitignore
- add code at file application.yml
username_postgres: postgres password_postgres: "password" port_postgres: "5432" host_postgres: localhost ```
- Execute
- Database creation.
- Execute the creation of the data base
rails db:create
- Execute the migration of the data base
rails db:migrate
- Execute the creation of the data base
- How to run the test suite.
- Execute
rspec
- Execute
- Routes.
- The following lines of code are API paths
GET http://localhost:port/api/v1/book POST http://localhost:port/api/v1/book ### Generate USER (CONSOLE) ### curl -X POST http://localhost:port/api/v1/authenticate -H "Content-Type: application/json" -d '{"username": "Book", "password": "Password1"}' ### Generate BOOK (CONSOLE) ### curl --header "Authorization: Bearer ###GENERATE TOKEN###" --header "Content-Type: application/json" --request POST --data '{"book": { "tile": "Eloquent Ruby" }, "author": { "fist_name": "Russ", "last_name": "Olsen", "age": 30 }}' http://localhost:port/api/v1/book -v
- Generate BEARER TOKEN
1. https://jwt.io/ 3. PAYLOAD: { "user_id": "Example" } 4. VERIFY SIGNATURE - Copy: secretK3y
-
Notifications
You must be signed in to change notification settings - Fork 0
ALAN1MACIAS/API-Library
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published