0)
this.imagenEscaparate =
- 'http://localhost:8090/api/productos/producto/imagen/' +
+ 'http://https://psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev/api/productos/producto/imagen/' +
this.producto.productoCaracteristicas.imagenesProducto[0].imagen;
}
diff --git a/clientes-app/src/app/producto/producto.service.ts b/clientes-app/src/app/producto/producto.service.ts
index 80279bd..f896016 100644
--- a/clientes-app/src/app/producto/producto.service.ts
+++ b/clientes-app/src/app/producto/producto.service.ts
@@ -1,12 +1,13 @@
-import { PersonaServices } from './../persona/persona.service';
-import { Router } from '@angular/router';
-import { Observable, of, throwError } from 'rxjs';
+import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
-import { Producto } from './producto.model';
-import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
-import { catchError, map, switchAll } from 'rxjs/operators';
+import { Router } from '@angular/router';
+import { Observable, throwError } from 'rxjs';
+import { catchError, map } from 'rxjs/operators';
+import { environment } from 'src/environments/environment';
import swal from 'sweetalert2';
import { Tienda } from '../configuracion/tienda.model';
+import { PersonaServices } from './../persona/persona.service';
+import { Producto } from './producto.model';
@Injectable({ providedIn: 'root' })
export class ServiceNameService {
@@ -17,21 +18,18 @@ export class ServiceNameService {
providedIn: 'root',
})
export class ProductoService {
- private urlProductosLista: string =
- 'http://localhost:8090/api/productos/lista';
- private urlProductoNuevo: string =
- 'http://localhost:8090/api/productos/producto/nuevo';
- private urlEndPoint: string = 'http://localhost:8090/api/productos/producto';
- private urlEliminarProducto: string =
- 'http://localhost:8090/api/productos/producto/borrar';
- private urlEliminarImagen: string =
- 'http://localhost:8090/api/productos/producto/borrar-imagen';
- private urlCambiarNombre: string =
- 'http://localhost:8090/api/productos/tienda/cambia-tienda';
- private urlNombre: string =
- 'http://localhost:8090/api/productos/tienda/nombre';
-
- private httpHeaders = new HttpHeaders({ 'Content-Type': 'application/json' });
+
+ // private urlRoot: string = '//psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev'
+ private urlRoot= environment.backEndURL;
+ private urlProductosLista: string = this.urlRoot + '/api/productos/lista';
+ private urlProductoNuevo: string = this.urlRoot + '/api/productos/producto/nuevo';
+ private urlEndPoint: string = this.urlRoot + '/api/productos/producto';
+ private urlEliminarProducto: string = this.urlRoot + '/api/productos/producto/borrar';
+ private urlEliminarImagen: string = this.urlRoot + '/api/productos/producto/borrar-imagen';
+ private urlCambiarNombre: string = this.urlRoot + '/api/productos/tienda/cambia-tienda';
+ private urlNombre: string = this.urlRoot + '/api/productos/tienda/nombre';
+
+ private httpHeaders = new HttpHeaders({ 'Content-Type': 'application/json'});
busqueda: string;
diff --git a/clientes-app/src/environments/environment.codespace.ts b/clientes-app/src/environments/environment.codespace.ts
new file mode 100644
index 0000000..b9bbd56
--- /dev/null
+++ b/clientes-app/src/environments/environment.codespace.ts
@@ -0,0 +1,4 @@
+export const environment = {
+ production: false,
+ backEndURL: '//psychic-succotash-5x944xv45qjh4wxr-8090.app.github.dev'
+ };
\ No newline at end of file
diff --git a/clientes-app/src/environments/environment.development.ts b/clientes-app/src/environments/environment.development.ts
new file mode 100644
index 0000000..91802b7
--- /dev/null
+++ b/clientes-app/src/environments/environment.development.ts
@@ -0,0 +1,4 @@
+export const environment = {
+ production: false,
+ backEndURL: '//localhost:8090'
+ };
\ No newline at end of file
diff --git a/clientes-app/src/environments/environment.prod.ts b/clientes-app/src/environments/environment.prod.ts
index 3612073..a00e1c9 100644
--- a/clientes-app/src/environments/environment.prod.ts
+++ b/clientes-app/src/environments/environment.prod.ts
@@ -1,3 +1,4 @@
export const environment = {
- production: true
+ production: true,
+ backEndURL: '//localhost:8090'
};
diff --git a/clientes-app/src/environments/environment.ts b/clientes-app/src/environments/environment.ts
index f56ff47..b9f7252 100644
--- a/clientes-app/src/environments/environment.ts
+++ b/clientes-app/src/environments/environment.ts
@@ -3,7 +3,8 @@
// The list of file replacements can be found in `angular.json`.
export const environment = {
- production: false
+ production: false,
+ backEndURL: '//localhost:8090'
};
/*