~sab/boo-test

Programming test
Update readme
Update readme
add files

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~sab/boo-test
read/write
git@git.sr.ht:~sab/boo-test

You can also use your local clone with git send-email.

#Starting the app

  1. Run npm install
  2. And run npm run start

#Creating a profile

curl -i -XPOST http://localhost:3000/api/profile -H "Content-Type: application/json" -d '{"id": "2", "name": "dfgsdfg", "description": "sdfdsfg", "mbti": "sdf", "enneagram": "fd", "variant": "dsf", "tritype": 435, "socionics": "dfg", "sloan": "fdg", "psyche": "dfg"}'

The above create could be verified by: (without an id in the url will default to 1, this is to avoid breaking the UI)

curl http://localhost:3000/2

#Adding a comment for a profile

curl -i -XPOST http://localhost:3000/api/comment -H "Content-Type: application/json" -d '{"title": "hello", "comment": "hey", "zodiac": "Aries", "mbti": "INFP", "enneagram": "1w2", "profile_id": "2", "commenter_id": "3"}'

#Like / Unlike a comment

curl -i -XPOST 'http://localhost:3000/api/comment/<commentId>/like' -H 'Content-Type: application/json' -d '{"liker_profile_id": "2"}'
curl -i -XPOST 'http://localhost:3000/api/comment/<commentId>/unlike' -H 'Content-Type: application/json' -d '{"liker_profile_id": "2"}'

#Run test

npm run test

#Start server

npm run start

#Known issues:

  1. The app might not work with OS that doesn't ship with libcrypto version 1.1
  2. Unique index in mongo memory server doesn't seem to work.
Do not follow this link