Mesmo alterando o ip conforme segue abaixo, não consigo logar-me na aplicação via mobile.
1) Provider do Usuario Service
import { Injectable } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import { Usuario } from '../../modelos/usuario';
@Injectable() export class UsuariosServiceProvider {
private _usuarioLogado: Usuario;
constructor(private _http: HttpClient) { }
efetuaLogin(email, senha) { return this._http.post('http://192.168.100.10:8080/api/login', { email, senha}) .do((usuario: Usuario) => this._usuarioLogado = usuario); }
obtemUsuarioLogado() { return this._usuarioLogado; } }
subindo aplicação Ionic = > ionic serve
marcos@marcos-Z450UAK:~/Documentos/ionic/6-aluracar/aluracar$ ionic serve Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser - Ctrl+C to cancel [08:20:40] watch started ... [08:20:40] build dev started ... [08:20:40] clean started ... [08:20:40] clean finished in 3 ms [08:20:40] copy started ... [08:20:40] deeplinks started ... [08:20:40] deeplinks finished in 65 ms [08:20:40] transpile started ... [08:20:42] transpile finished in 2.16 s [08:20:42] preprocess started ... [08:20:42] preprocess finished in less than 1 ms [08:20:42] webpack started ... [08:20:42] copy finished in 2.39 s [08:20:48] webpack finished in 5.94 s [08:20:48] sass started ... [08:20:49] sass finished in 922 ms [08:20:49] postprocess started ... [08:20:49] postprocess finished in 7 ms [08:20:49] lint started ... [08:20:49] build dev finished in 9.19 s [08:20:49] watch ready in 9.26 s [08:20:49] dev server running: http://localhost:8100/
[OK] Development server running! Local: http://localhost:8100 External: http://192.168.100.10:8100 DevApp: aluracar@8100 on marcos-Z450UAK
[08:20:52] lint finished in 2.94 s
subindo o webservice - npm start 192.168.100.10
marcos@marcos-Z450UAK:~/Documentos/ionic/aluracar-webservice$ npm start 192.168.100.10
api@1.0.0 start /home/marcos/Documentos/ionic/aluracar-webservice node server.js "192.168.100.10"
Servidor rodando em http://192.168.100.10:8080
No celular abre o aplicativo mas não consigo logar, surge a mensagem de erro: "Falha Login, tente de novo"