Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Latest commit

 

History

History
78 lines (44 loc) · 1.57 KB

README.md

File metadata and controls

78 lines (44 loc) · 1.57 KB

jersey2-jackson-mongo-todo

A sample project setup using Jersey 2 + Jackson 2 + MongoDB, that implements a simple TO-DO note REST API.

  • GET /todo

    List To-Do items.

  • GET /todo?q=[query-text]

    Search "title" and "body" contents for matching TO-DO items.

  • POST /todo

    {"title": "...", "body": "...", done: false}

    Create a TO-DO item.

  • PUT /todo/[id]

    {...}

    (Full) Update of a TO-DO item.

  • PUT /todo/[id]/patch

    {...}

    Patch (partial update) of a TO-DO item.

  • PUT /todo/[id]/patch

    { "done": true }

    Mark done (when value is true) or undone (when value is false).

  • PUT /todo/[id]/patch

    { "done": true, ", smsPhoneNo: "6501234567" }

    Mark done and send SMS message.

  • DELETE /todo/[id]

    Delete a TO-DO item.

To Run in Local System

Heroku Env Variables

heroku config:set MONGODB_URL="..."
heroku config:set SEARCH_URL="https://site:{api-key}@{site}.searchly.com"

Optionally if you want to try SMS when "done" is marked:

heroku config:set TWILIO_ACCOUNT_SID="..."
heroku config:set TWILIO_AUTH_TOKEN="..."
heroku config:set TWILIO_FROM_PHONE_NO="+1##########"