This project is a simple Node.js web server designed to act as a backend for a Glance dashboard extension. It fetches tasks from the Todoist API, formats them into HTML, and serves them on different endpoints. It provides views for tasks sorted by priority and by due date, and includes functionality to mark tasks as complete.
Follow these steps to get the application running on your local machine.
The application requires your Todoist API token to be set as an environment variable.
Create a file named .env in the root of your glance directory.
touch .envOpen the .env file and add your Todoist API token.
You can find your token in your Todoist account under Settings > Integrations > Developer > API Token.
# .env
# Add your Todoist API token below
TODOIST_API_TOKEN="YOUR_TODOIST_API_TOKEN_HERE"Add the following to your glance docker-compose.yml
glance-todoist:
image: reujdon/glance-todoist:latest
ports:
- "8082:8082"
env_file:
- .env
restart: alwaysAdd to Glance by adding the below code to your glance config.
- type: extension
url: http://glance-todoist:8082/api/priority?project_id=<your_project_id>
cache: 1m
allow-potentially-dangerous-html: true
GET /api/priority?project_id=<id>: Returns an HTML view of tasks sorted by priority.GET /api/date?project_id=<id>: Returns an HTML view of tasks sorted by due date.POST /api/tasks/:id/close: Marks a specific task as complete. Called by the "done" button in the HTML.
- Fix glance unable to remove tasks