A simple notes API. Your task is to add authentication.
- Clone the repository
- Install dependencies:
npm install
- Copy
.env.exampleto.envand fill in your values:cp .env.example .env
- Start the development server:
npm run dev
- A working
Notemodel withtitle,body, andcreatedAt - Routes for
GET /notes,POST /notes, andDELETE /notes/:id - Error handling middleware
- Stubs for everything you'll implement
| Method | Path | Auth required | Description |
|---|---|---|---|
GET |
/notes |
No | List all notes |
POST |
/notes |
No | Create a note |
DELETE |
/notes/:id |
Yes | Delete a note |
POST |
/auth/register |
No | Register a new user |
POST |
/auth/login |
No | Log in and get a token |
GET |
/auth/me |
Yes | Get current user profile |