Skip to main content
Front Helpdesk consists of two Angular applications — admin and public — each with its own environment configuration. These files control whether the app runs in development or production mode and which backend URL it targets.

Admin environment files

The admin app reads its backend URL from projects/admin/src/environments/environment.ts:
projects/admin/src/environments/environment.ts
export const environment = {
  production: false,
  apiBase: 'http://127.0.0.1:8000'
};
The production counterpart lives at projects/admin/src/environments/environment.prod.ts:
projects/admin/src/environments/environment.prod.ts
export const environment = {
  production: true,
  apiBase: 'hhttps://back-helpdesk-dmep.onrender.com'
};
The apiBase value in environment.prod.ts contains a typo — hhttps:// has a double h. Correct it to https:// before deploying to production, or replace the URL entirely with your own backend.

How apiBase is used

AuthService imports environment directly and stores apiBase as its base URL for all HTTP calls:
projects/admin/src/app/core/auth/auth.service.ts
import { environment } from '../../../environments/environment';

@Injectable({ providedIn: 'root' })
export class AuthService {
  private base = environment.apiBase;

  login(email: string, password: string) {
    return this.http.post<any>(`${this.base}/api/auth/login`, { email, password });
  }
}
Angular replaces environment.ts with environment.prod.ts automatically when you build with the production configuration (see Switching environments below).

Setting a different backend URL

Update apiBase in the appropriate file for the target environment:
export const environment = {
  production: true,
  apiBase: 'https://your-backend.example.com'
};
The default value http://127.0.0.1:8000 points to a local development server. Replace it in environment.prod.ts before deploying the admin app to production.

Switching environments

Angular CLI selects the correct environment file based on the --configuration flag. Development (default) — uses environment.ts:
ng serve
# or for a named project
ng serve admin
ng serve public
Production — uses environment.prod.ts:
ng build --configuration production
You can also define custom named configurations (for example, staging) in angular.json and add a matching environment.staging.ts file, then build with:
ng build --configuration staging
See the Angular deployment guide for details on managing multiple environments.

Build docs developers (and LLMs) love