/**
     * Launch an API instance
     * @param self
     */
Launch an API instance
@param self
Launch an API instance @param self
pub fn start(&mut self) {
        let mut router = Router::new();
        // Init routes
        let say_handler = SayHandler {
            user_text: self.user_text.clone()
        };
        let start_listening_handler = StartListeningHandler {
            is_listening: self.is_listening.clone()
        };
        let stop_listening_handler = StopListeningHandler {
            is_listening: self.is_listening.clone()
        };
        router.post("/say", say_handler, "say");
        router.get("/startListen", start_listening_handler, "start");
        router.get("/stopListen", stop_listening_handler, "stop");
        // Start router
        Iron::new(router).http("localhost:3000").unwrap();
    }
pub fn start ( & mut self ) { let mut router = Router :: new ( ) ; // Init routes let say_handler = SayHandler { user_text : self . user_text . clone ( ) } ; let start_listening_handler = StartListeningHandler { is_listening : self . is_listening . clone ( ) } ; let stop_listening_handler = StopListeningHandler { is_listening : self . is_listening . clone ( ) } ; router . post ( " " , say_handler , " " ) ; router . get ( " " , start_listening_handler , " " ) ; router . get ( " " , stop_listening_handler , " " ) ; // Start router Iron :: new ( router ) . http ( " " ) . unwrap ( ) ; }
Launch an API instance
 @param self
Launch an API instance @param self
&mut self