Chore: Update README.md
- my thoughts
This commit is contained in:
@@ -1,54 +1,14 @@
|
|||||||
# Spring Boot Note Api
|
# Spring Boot Note Api
|
||||||
|
|
||||||
I'm testing spring boot, and it might become my main framework for building APIs
|
> I'm testing spring boot, and it might become my main framework for building APIs
|
||||||
|
|
||||||
## Authentication Endpoints
|
---
|
||||||
Handle user registration and login. All return JWT tokens on success.
|
|
||||||
|
|
||||||
### `POST /api/auth/register` - Register a new user
|
486 days have passed since I started this project, well, lets rewrite it to DDD + clean and just finish that mini project.
|
||||||
Request body:
|
I created an archive branch for old code.
|
||||||
```json
|
|
||||||
{
|
|
||||||
"username":"Tokishu",
|
|
||||||
"password":"SuperSecretPassword"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### `POST /api/auth/login` - Authorize
|
but for alll that time i didnt learn how to make normal tests for my code, cuz i
|
||||||
Request body:
|
learned spring boot and java core superfically
|
||||||
```json
|
|
||||||
{
|
|
||||||
"username":"Tokishu",
|
|
||||||
"password":"SuperSecretPassword"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### `/api/auth/new-root` - Initial setup endpoint to create a root user (e.g. admin), can only be used once.
|
i think it will be better to make tests "in the progress", eeeh, for example: new feature, some tests for that, one more feature...
|
||||||
|
and so on.
|
||||||
## Note Endpoints
|
|
||||||
All endpoints below require a valid Bearer token in the `Authorization` header.
|
|
||||||
`Authorization: Bearer <your_token>`
|
|
||||||
|
|
||||||
### `GET /api/notes` - Get all notes
|
|
||||||
|
|
||||||
### `GET /api/note/{id}` - Find note by id
|
|
||||||
|
|
||||||
### `POST /api/note` - Add a new note
|
|
||||||
Request body:
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"name":"What should I buy?",
|
|
||||||
"text":"Tanya's note"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### `PUT /api/note/{id}` - Update note
|
|
||||||
Request body:
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"name":"What should I buy?",
|
|
||||||
"text":"I bought the apple!"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### `DELETE /api/note/{id}` - Delete note
|
|
||||||
Reference in New Issue
Block a user