To create the module, create a new file named data_service.rs in the /src directory.
Since we will be using the actix-web and couchdb functionality, we need to declare our use statement at the top of the file.
use super::*;
use actix_web::{App, http, HttpRequest, HttpResponse};
use actix_web_httpauth::extractors::basic::BasicAuth;
use super::couchdb::{CouchDB};
use std::thread;
Tests
Add the following unit test to the bottom of the module to cover the basic funcitonality.
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_get_service_root() {
assert_eq!(get_service_root(), format!("/data/{}", VER));
}
}