โ† All tutorials
๐Ÿ’œ

Cursor ยท Node.js + Express

Build a Todo API with Cursor

Prerequisites

  • โœ“ Cursor IDE installed
  • โœ“ Node.js installed
  • โœ“ Git installed
  • โœ“ Qmmit installed
  • โœ“ A Qmmit account with CLI token
1

Create the project

Set up a new Node.js project with Express.

mkdir todo-api
cd todo-api
npm init -y
npm install express
git init
echo "node_modules/" > .gitignore
git add . && git commit -m "initial: express project"
2

Set up Qmmit

Initialize Qmmit tracking.

qmmit init
# Paste your CLI token
โšก

What Qmmit does here

Detects Cursor in your installed tools. Installs 3 git hooks.

3

Open in Cursor and build the API

Open the project folder in Cursor. Use the chat or Agent mode to build the API.

# Open Cursor:
cursor .

# In Cursor chat, ask:
# "Create an Express REST API with these endpoints:
#  GET /todos - list all todos
#  POST /todos - create a todo
#  PUT /todos/:id - update a todo
#  DELETE /todos/:id - delete a todo
#  Use an in-memory array for storage."
๐Ÿ’ก

Cursor Agent mode creates files directly. Qmmit detects this via workspaceStorage mapping โ€” no file paths needed in the conversation.

4

Ask Cursor to add validation

Ask Cursor to add input validation to the API.

# In Cursor:
# "Add input validation: title is required, must be a string,
#  max 200 characters. Return 400 with error message if invalid."
5

Ask Cursor to add error handling

One more prompt โ€” add proper error handling.

# In Cursor:
# "Add a global error handler middleware and 404 handler.
#  Return JSON error responses with status codes."
6

Test the API

Start the server and test with curl.

node index.js &
curl http://localhost:3000/todos
curl -X POST http://localhost:3000/todos -H "Content-Type: application/json" -d '{"title":"Buy milk"}'
curl http://localhost:3000/todos
7

Commit

Commit everything. Qmmit captures all 3 Cursor prompts.

git add .
git commit -m "feat: todo REST API with validation"

# Expected:
# [qmmit] 3 prompt(s) tracked (cursor) โ†’ def5678
โšก

What Qmmit does here

Reads Cursor state.vscdb, finds 3 user prompts from this workspace, deduplicates, links to commit.

8

Push and verify

Push to GitHub and check your dashboard.

git remote add origin https://github.com/YOU/todo-api.git
git push -u origin main

# Check: qmmit.dev/yourusername
# Should show: todo-api project, 3 prompts, cursor/auto model
Qmmit โ€” Verified AI Developer Portfolio