Interacting with our auth server
Our auth server can create users and login those users. We might as well plug our auth server into our ingress server and make some API calls.
First, we must declare our auth server and the auth data access layer in the ingress Cargo.toml file with the following code:
# ingress/Cargo.toml
auth_server = {
path = "../nanoservices/auth/networking/actix_server",
package = "auth_actix_server"
}
auth-dal = {
path = "../nanoservices/auth/dal",
package = "auth-dal"
}
We can now import these dependencies with the code below:
// ingress/src/main.rs
use auth_server::api::views_factory as auth_views_factory;
use auth_dal::migrations::run_migrations as run_auth_migrations;
We can now run our migrations and attach our auth endpoints to our ingress server. Once we have done this, our main function looks like the following:
// ingress/src/main.rs
#[tokio::main]
async fn main() -> std::io::Result<()>...