-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Axum #23
Comments
Outline for #11 |
@Wulf I would like to work on this task. I have started by adding I would like to add features for the new backend step by step as I learn more about the axum framework and its workings. |
hey @vishalsodani, hope things are well. Sorry for being super late with my reply. It would be awesome if you added Axum! Step by step is exactly how I integrated Some things you should know in general:
Apart from that, I went over the codebase once again and found places where you may want to add in Axum-related implementation / CLI options / etc. I've split the notes based on the project it pertains to: create-rust-app_cli
create-rust-app
I tried to over-explain everything to make it clear so sorry if it was too wordy. After all this you'll hopefully have a working axum project which you can tweak further. cd repo/create-rust-app_cli
cargo run -- test-project
# don't select any plugins~ Just a note, don't generate a project named 'test' -- it's not a legal cargo project name apparently -- I've run into this so many times now haha. If you choose to use another name for your generated test project (that isn't "test-project"), you should add it to the exclude array in cargo install --path repo/create-rust-app_cli
cd /somewhere/else
create-rust-app my-project
# don't select any plugins~ Let me know if I can help in any other way! |
@Wulf Thanks for sharing so many pointers :) This |
Hi @vishalsodani. Could I ask we done intergrated Axum? |
Sorry, no. |
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
)The text was updated successfully, but these errors were encountered: