Open Wulf opened 2 years ago
BackendFramework
main.rs
create-rust-app_cli/template/src/
/api/todos
todo.rs
#[cfg(not(debug_assertions))]
./frontend/build
index.html
create-rust-app_cli/template/src/services
GET /
GET /id
POST /
PUT /:id
DELETE /:id
(we can get to these later)
/api/auth
files.rs
Outline for #11
Adding a backend framework
Base requirements for each framework:
BackendFramework
enummain.rs
which starts the server increate-rust-app_cli/template/src/
/api/todos
endpoints (seetodo.rs
below)#[cfg(not(debug_assertions))]
) serves files from./frontend/build
with theindex.html
as the defaulttodo.rs
which serves the CRUD endpoints for the example 'todo' service increate-rust-app_cli/template/src/services
GET /
: returns a JSON list of all TODO itemsGET /id
: return a single JSON TODO itemPOST /
: creates and returns a single JSON TODO itemPUT /:id
: updates and returns a single JSON TODO itemDELETE /:id
: deletes a single item, returns 200 status codeOptional requirements:
(we can get to these later)
/api/auth
routesfiles.rs
)