[DEBUG] correct the production environement
This commit is contained in:
parent
46d9bb3092
commit
4e041c5bea
@ -20,7 +20,7 @@ ENV PATH /application/node_modules/.bin:$PATH
|
|||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# generate build
|
# generate build
|
||||||
RUN ng build --output-path=dist --configuration=production
|
RUN ng build --output-path=dist --configuration=production --deploy-url=/karideo/
|
||||||
|
|
||||||
############
|
############
|
||||||
### prod ###
|
### prod ###
|
||||||
|
@ -10,6 +10,7 @@ import { Injectable, Component, OnInit, Input } from '@angular/core';
|
|||||||
import { Router } from "@angular/router";
|
import { Router } from "@angular/router";
|
||||||
import { ActivatedRoute, Params } from '@angular/router';
|
import { ActivatedRoute, Params } from '@angular/router';
|
||||||
import { VideoService } from '../video.service';
|
import { VideoService } from '../video.service';
|
||||||
|
import { HttpWrapperService } from '../http-wrapper.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-element-video',
|
selector: 'app-element-video',
|
||||||
@ -37,7 +38,8 @@ export class ElementVideoComponent implements OnInit {
|
|||||||
video_source:string = ""
|
video_source:string = ""
|
||||||
video_enable:boolean = false;
|
video_enable:boolean = false;
|
||||||
constructor(private router: Router,
|
constructor(private router: Router,
|
||||||
private videoService: VideoService) {
|
private videoService: VideoService,
|
||||||
|
private httpService: HttpWrapperService) {
|
||||||
|
|
||||||
}
|
}
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@ -57,7 +59,7 @@ export class ElementVideoComponent implements OnInit {
|
|||||||
self.time = response.time;
|
self.time = response.time;
|
||||||
self.generated_name = response.generated_name;
|
self.generated_name = response.generated_name;
|
||||||
if (self.data_id != -1) {
|
if (self.data_id != -1) {
|
||||||
self.video_source = "http://localhost:15080/data/" + self.data_id;
|
self.video_source = self.httpService.createRESTCall("data/" + self.data_id);
|
||||||
self.video_enable = true;
|
self.video_enable = true;
|
||||||
} else {
|
} else {
|
||||||
self.video_source = "";
|
self.video_source = "";
|
||||||
|
@ -3,7 +3,7 @@ import { Injectable } from '@angular/core';
|
|||||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
import { catchError, map, tap } from 'rxjs/operators';
|
import { catchError, map, tap } from 'rxjs/operators';
|
||||||
|
|
||||||
import { createRESTCall } from 'environments/environment';
|
import { environment } from 'environments/environment';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class HttpWrapperService {
|
export class HttpWrapperService {
|
||||||
@ -12,8 +12,29 @@ export class HttpWrapperService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createRESTCall(_api:string, _options:any = undefined) {
|
||||||
|
let basePage = environment.apiUrl;
|
||||||
|
let addressServerRest = basePage + "/";
|
||||||
|
let out;
|
||||||
|
if (typeof _options === 'undefined') {
|
||||||
|
_options = [];
|
||||||
|
}
|
||||||
|
out = addressServerRest + _api;
|
||||||
|
let first = true;
|
||||||
|
for (let iii=0; iii<_options.length; iii++) {
|
||||||
|
if (first ==false) {
|
||||||
|
out += "&";
|
||||||
|
} else {
|
||||||
|
out += "?";
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
out += _options[iii];
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
get(_uriRest:string, _headerOption:any, _params:any) {
|
get(_uriRest:string, _headerOption:any, _params:any) {
|
||||||
let connectionAdresse = createRESTCall(_uriRest, {});
|
let connectionAdresse = this.createRESTCall(_uriRest, {});
|
||||||
let config = {
|
let config = {
|
||||||
params: _params,
|
params: _params,
|
||||||
headers: new HttpHeaders(_headerOption)
|
headers: new HttpHeaders(_headerOption)
|
||||||
@ -49,7 +70,7 @@ export class HttpWrapperService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
post(_uriRest:string, _headerOption:any, _data:any) {
|
post(_uriRest:string, _headerOption:any, _data:any) {
|
||||||
let connectionAdresse = createRESTCall(_uriRest, {});
|
let connectionAdresse = this.createRESTCall(_uriRest, {});
|
||||||
const httpOption = {
|
const httpOption = {
|
||||||
headers: new HttpHeaders(_headerOption)
|
headers: new HttpHeaders(_headerOption)
|
||||||
};
|
};
|
||||||
|
@ -6,29 +6,7 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
// URL of development API
|
// URL of development API
|
||||||
apiUrl: 'http://192.168.1.157/karideo/api/',
|
apiUrl: 'http://192.168.1.157/karideo/api',
|
||||||
//apiMode: "QUERRY"
|
apiMode: "QUERRY"
|
||||||
apiMode: "REWRITE"
|
//apiMode: "REWRITE"
|
||||||
}
|
}
|
||||||
|
|
||||||
export let createRESTCall = function(api, options) {
|
|
||||||
let basePage = environment.apiUrl;
|
|
||||||
let addressServerRest = basePage + "/";
|
|
||||||
let out;
|
|
||||||
if (typeof options === 'undefined') {
|
|
||||||
options = [];
|
|
||||||
}
|
|
||||||
out = addressServerRest + api;
|
|
||||||
let first = true;
|
|
||||||
for (let iii=0; iii<options.length; iii++) {
|
|
||||||
if (first ==false) {
|
|
||||||
out += "&";
|
|
||||||
} else {
|
|
||||||
out += "?";
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
out += options[iii];
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -10,61 +10,3 @@ export const environment = {
|
|||||||
//apiMode: "QUERRY"
|
//apiMode: "QUERRY"
|
||||||
apiMode: "REWRITE"
|
apiMode: "REWRITE"
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief create the rest call element of the link
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
export let createRESTCall = function(api, options) {
|
|
||||||
let basePage = environment.apiUrl;
|
|
||||||
let addressServerRest = basePage + "/api/v1/";
|
|
||||||
let out;
|
|
||||||
if (environment.apiMode == "QUERRY") {
|
|
||||||
out = addressServerRest + "?REST=" + api
|
|
||||||
if (typeof options === 'undefined') {
|
|
||||||
options = [];
|
|
||||||
}
|
|
||||||
for (let iii=0; iii<options.length; iii++) {
|
|
||||||
out += "&" + options[iii];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (typeof options === 'undefined') {
|
|
||||||
options = [];
|
|
||||||
}
|
|
||||||
out = addressServerRest + api;
|
|
||||||
let first = true;
|
|
||||||
for (let iii=0; iii<options.length; iii++) {
|
|
||||||
if (first ==false) {
|
|
||||||
out += "&";
|
|
||||||
} else {
|
|
||||||
out += "?";
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
out += options[iii];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export let createRESTCall = function(api, options) {
|
|
||||||
let basePage = environment.apiUrl;
|
|
||||||
let addressServerRest = basePage + "/";
|
|
||||||
let out;
|
|
||||||
if (typeof options === 'undefined') {
|
|
||||||
options = [];
|
|
||||||
}
|
|
||||||
out = addressServerRest + api;
|
|
||||||
let first = true;
|
|
||||||
for (let iii=0; iii<options.length; iii++) {
|
|
||||||
if (first ==false) {
|
|
||||||
out += "&";
|
|
||||||
} else {
|
|
||||||
out += "?";
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
out += options[iii];
|
|
||||||
}
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user