DEV Community

Discussion on: Practical Rust Web Development - API Rest

Collapse
 
saroar profile image
Saroar Khandoker

you don't have models.rs? in ur project so it confuse for newcomer :) prnt.sc/p0bfqb

Collapse
 
werner profile image
Werner Echezuría

Oops!, thanks for pointing this out, fixed now.

Collapse
 
saroar profile image
Saroar Khandoker

thanks also like to know so you know about the swift back end? I am a little bit confuse is Rust is ready for the production type of API app for a mobile app? i have my own API written in swift that's working good but i am also interested in RUST so i start to reading you post :)

Thread Thread
 
werner profile image
Werner Echezuría

I think as an API backend Rust is ready for production, might need to polish some areas but you could have your app deployed with confident. for example: figma.com/blog/rust-in-production-...

Thread Thread
 
saroar profile image
Saroar Khandoker

do you know swift back end like vapor ? if yes what you think about swift back end?
thanks

Thread Thread
 
werner profile image
Werner Echezuría

To be honest, I don't know swift, so I can't make an informed opinion about it.

Thread Thread
 
saroar profile image
Saroar Khandoker

ok no worry thanks for reply also check this prnt.sc/p0et3l image you don't have still extern crate futures; and you add it so its give us error too

  --> src/main.rs:16:1
   |
16 | extern crate futures;
   | ^^^^^^^^^^^^^^^^^^^^^ can't find crate

Thread Thread
 
saroar profile image
Saroar Khandoker

also, i follow your tutorial till here Finally goes to http://localhost:8088/products.
but and trying to understand why it not showing :( my products list already debugging more then 2 hours :(

Thread Thread
 
saroar profile image
Saroar Khandoker

here is my code please check me if you will have
bitbucket.org/Alifdev/ruststore

Thread Thread
 
werner profile image
Werner Echezuría

Hi, sorry for the late response, I was on vacations. Try to follow these tips and tell me if it works.

  1. git checkout v1.1.
  2. diesel setup.
  3. cargo run.
  4. curl http://127.0.0.1:8088/products -H "Content-Type: application/json" -d '{"name": "socks", "stock": 7, "price": 2}
  5. curl http://localhost:8088/products

Tell me if it works.

Thread Thread
 
saroar profile image
Saroar Khandoker

yes it is working thanks :)