formation пре 4 година
родитељ
комит
19f301689f

+ 1 - 1
angular-client/src/app/services/auth.service.ts

@@ -17,7 +17,7 @@ import * as jwt_decode from 'jwt-decode';
 export class AuthService {
 
   //url api
-  private apiUrl = 'http://localhost:4000'
+  private apiUrl = environment.apiUrl
 
 
   private tokenSubject: BehaviorSubject<Token>;

+ 1 - 1
angular-client/src/app/services/contact.service.ts

@@ -12,7 +12,7 @@ export class ContactService {
   constructor(private http: HttpClient) { }
 
   //url api
-  private apiUrl = 'http://localhost:4000'
+  private apiUrl = environment.apiUrl
 
   // send message contact
   sendMsgContact(credentials): Observable<any> {

+ 1 - 1
angular-client/src/app/services/email.service.ts

@@ -12,7 +12,7 @@ export class EmailService {
   constructor(private http : HttpClient) { }
 
   //url api
-  private apiUrl = 'http://localhost:4000'
+  private apiUrl = environment.apiUrl
 
 // send email 
 sendEmail(data : Email, email: string, isgain: string, isactiive: string): Observable<Email> {

+ 1 - 1
angular-client/src/app/services/restaurants.service.ts

@@ -12,7 +12,7 @@ export class RestaurantsService {
   constructor(private http : HttpClient) { }
 
   //url api
-  private apiUrl = 'http://localhost:4000'
+  private apiUrl = environment.apiUrl
 
   // get users
 getRestaurants(): Observable<Restaurant[]> {

+ 1 - 1
angular-client/src/app/services/statistic.service.ts

@@ -25,7 +25,7 @@ private headers = new HttpHeaders(
 getStatistic(): Observable<StatisticResponse> {
 //  return this.http.get<StatisticResponse>('assets/data/stat.json');
 const options = { headers: this.headers};
- let data = this.http.get<StatisticResponse>('http://localhost:4000/api/tickets/stats',options);
+ let data = this.http.get<StatisticResponse>('environment.apiUrl/api/tickets/stats',options);
  console.log(JSON.stringify(data));
  return data;
  

+ 1 - 1
angular-client/src/app/services/users.service.ts

@@ -12,7 +12,7 @@ export class UsersService {
   constructor(private http : HttpClient) { }
 
  //url api
- private apiUrl = 'http://localhost:4000'
+ private apiUrl = environment.apiUrl
 
 // get all users
 getUsers(page: number, limit:number, lastname:string, firstname:string, email:string, adress:string, startregister, endregister): Observable <UserResponse> {

+ 4 - 4
express-server/lib/db.js

@@ -5,11 +5,11 @@ const  config  = require('../config/config.json');
 // const { User } = require('../models/user.model');
  //const bcrypt = require('bcrypt');
 // const Role = require('../lib/role');
-const db = config.url;
+//const db = config.url;
 
-//var db = 'mongodb://database_preprod:27017/mean-fatboar-db';
-var mongoURI = 'mongodb://localhost:27017/my-db';
-mongoose.set('useCreateIndex', true)
+var db = 'mongodb://database_preprod:27017/mean-fatboar-db';
+//var mongoURI = 'mongodb://localhost:27017/my-db';
+//mongoose.set('useCreateIndex', true)
 mongoose.connect(db, {useNewUrlParser: true, useUnifiedTopology: true })
 .then(() => {
     console.log("Successfully connected to the database.");