Skip to content

Proxy and Festival resource path incorrect #8

@v-mwalk

Description

@v-mwalk

When Coding Test website (./web) is executed a blank page is shown.

This is due to the Proxy Config pointing the wrong URL and Data Services Festivals urls containing incorrect path. To resolve;

/web/proxy.conf.js should read:-

const PROXY_CONFIG = {
  '/codingtest/*': {
    'target': `https://eacp.energyaustralia.com.au/`,
    'secure': true,
	'changeOrigin': true,
    'logLevel': 'debug',
  },
};
module.exports = PROXY_CONFIG;

and /web/src/app/core/data-services/festival-data.service.ts should read:-

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { Festival } from '../models/festival.model';

@Injectable({ providedIn: 'root' })
export class FestivalDataService {

  private urls = {
    festivals: '/codingtest/api/v1/festivals',
  };

  constructor(private http: HttpClient) { }

  public getFestivalsData(): Observable<Array<Festival>> {
    return this.http.get<Array<Festival>>(`${this.urls.festivals}`);
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions