- For both projects, clone this repo and cd into the directory. This is the workspace root folder.
- From one terminal window, run:
cargo run -p tcpserver
- From another terminal window, run:
cargo run -p tcpclient
You should see the following message printed to your terminal window from where the client is run:
Got response from server:"Hello"
- To just run the tests:
cargo test -p http
You should see the following message printed to your terminal:
test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
- From a terminal window, run:
cargo run -p httpserver
- From a web browser, access the following URIs:
localhost:3000
localhost:3000/health
localhost:3000/api/shipping/orders
localhost:3000/invalid-page
For the first two URIs, you should be able to see the corresponding HTML pages served. For the third URI, you should be able to see json data returned from the server. For the last request, you should see a 404 error page.