This template should help get you started developing with Vue 3 in Vite.
VS Code + Vue (Official) (and disable Vetur).
- Chromium-based browsers (Chrome, Edge, Brave, etc.):
- Firefox:
See Vite Configuration Reference.
npm installnpm run devThis starts two things side by side:
- the todo API (
server/) on port 3001, which reloads when files inserver/change - the Vite dev server, which forwards
/apirequests to the API
Todos are stored in SQLite at data/todos.sqlite (ignored by git), so they survive a page refresh
and a restart. Set TODO_DB to use a different file, or PORT to move the API to another port.
To run only the API, use npm run start:api.
| Method | Path | Body |
|---|---|---|
| GET | /api/todos |
|
| POST | /api/todos |
{ "title": "Buy milk", "priority": true } |
| PATCH | /api/todos/:id |
any of title, done, priority |
| DELETE | /api/todos/:id |
|
| DELETE | /api/todos/completed |
clears every done todo |
npm run buildRun Unit Tests with Vitest
npm run test:unitLint with ESLint
npm run lint