This project is a clone of todoist to benefit who wants to get a open source project and get the same result of this amazing tecnology
config dotenv variables:
db_user=root
db_pass=root
db_host=postgres
starting server rails and webpack
sudo docker-compose up --build
create and migrate database:
sudo docker-compose run --rm web_app rails db:create db:migrate
rspec
sudo docker-compose run --rm web_app rspec
rubocop
sudo docker-compose run --rm web_app rubocop -A
brakeman
sudo docker-compose run --rm web_app brakeman
Get
-
curl:
curl -X "GET" 'http://localhost:3000' --cookie-jar cookie | grep csrf
-
return:
<meta name="csrf-token" content="+io2dtE6WwojAf+w1Uc0zuObAOOZ7INTyGT5M5wjagWEUw3O5M3fZrun4HHbLYouFDhn5rl5Seuo1PJgCTNJTg==" />
Create
-
curl:
curl -kv -H 'Content-Type: application/json' -d '{"users": { "email": "root@root.com", "password": "123456"}, "authenticity_token": "eZHlcA3MW7i4Kfl6lo4i7wvE6V54x3SZcdIvWYXT5idHpnjTFgA+rjIzFbp78L3jnXLmAnVcSEA2rBHpw7JbOA==" }' --cookie cookie -X 'POST' "http://localhost:3000/api/v1/sessions" | jq
-
status_code: 201 Created
-
return:
{ "authentication_token": "2yPsyWBjLPci4xoyzaG4" }
Get
-
curl:
curl -kv -H 'Content-Type: application/json' -H 'token: 2yPsyWBjLPci4xoyzaG4' --cookie cookie -X 'GET' "http://localhost:3000/api/v1/projects" | jq
-
status_code: 200 Ok
-
return:
[]
-