another readme update
This commit is contained in:
parent
03257ef1e3
commit
edfdb0405b
@ -40,7 +40,7 @@ A useful package for serializing and deserializing data (specifically json), use
|
|||||||
Our applications main entry point, here we declare the use of the applications external packages for easier management.
|
Our applications main entry point, here we declare the use of the applications external packages for easier management.
|
||||||
`main` is then responsible for creating the new question `store` (behind the necessary tokio `RwLock`). `main` creates the axum router, and specifies all of the routes our application supports by pointing them to handlers in the `src/api.rs` file via the appropriate http methods, before serving the axum service
|
`main` is then responsible for creating the new question `store` (behind the necessary tokio `RwLock`). `main` creates the axum router, and specifies all of the routes our application supports by pointing them to handlers in the `src/api.rs` file via the appropriate http methods, before serving the axum service
|
||||||
#### src/api.rs
|
#### src/api.rs
|
||||||
Five handler are defined here for our five API endpoints, supporting the basic CRUD operations regarding questions. Care was taken to handle most common possible error cases, such as attempting to get a question by an id which does not exist, or attempting to create a question with the same ID as one that already exists.
|
Five handlers are defined here for our five API endpoints, supporting the basic CRUD operations regarding questions. Care was taken to handle most common possible error cases, such as attempting to get a question by an id which does not exist, or attempting to create a question with the same ID as one that already exists.
|
||||||
|
|
||||||
Some minor derivations were taken here from the exact routes specified in the text
|
Some minor derivations were taken here from the exact routes specified in the text
|
||||||
* GET /question/:id is included to return a specific question by id
|
* GET /question/:id is included to return a specific question by id
|
||||||
@ -64,14 +64,15 @@ These are a few things still to be added
|
|||||||
#### Higher priority
|
#### Higher priority
|
||||||
* Support pagination (via query parameters) for GET /questions. Omission of the query parameters would default in page 0 and a page size of ~10
|
* Support pagination (via query parameters) for GET /questions. Omission of the query parameters would default in page 0 and a page size of ~10
|
||||||
* Support POST /answers
|
* Support POST /answers
|
||||||
|
* Add some simple API curl examples to this README
|
||||||
* API documentation tooling (`utoipa`)
|
* API documentation tooling (`utoipa`)
|
||||||
* API testing tooling (`swagger`)
|
* API testing tooling (`swagger`)
|
||||||
* Coded API tests with mock data
|
* Coded API tests with mock data
|
||||||
* Specific defined Error types for common errors
|
* Specific defined Error types for common errors
|
||||||
* Serve basic web page(s) to utilize all APIs
|
|
||||||
#### Lesser priority
|
#### Lesser priority
|
||||||
* Optimize flush/file writing: Write out the JSON in a pretty structure and avoid re-writing the whole file in cases when it can be avoid (like adding 1 item)
|
* Optimize flush/file writing: Write out the JSON in a pretty structure and avoid re-writing the whole file in cases when it can be avoid (like adding 1 item)
|
||||||
* Use a database alltogether instead of a json file for persistance
|
* Use a database alltogether instead of a json file for persistance
|
||||||
|
* Serve basic web page(s) to utilize all APIs
|
||||||
* Re-structure the application to serve API endpoint from an `api` directory, and generically serve web content from a `web` directory
|
* Re-structure the application to serve API endpoint from an `api` directory, and generically serve web content from a `web` directory
|
||||||
* Optimize the put/update handler to support path or body identification, and to update only individual fields passed.
|
* Optimize the put/update handler to support path or body identification, and to update only individual fields passed.
|
||||||
* Host application on my raspberry pi on the internet
|
* Host application on my raspberry pi on the internet
|
||||||
|
Reference in New Issue
Block a user