import { HttpInterceptorFn } from "@angular/common/http";

import { environment } from '@environments/environment';

export const apiInterceptor: HttpInterceptorFn = (req, next) => {
    const apiReq = req.clone({
        setHeaders: {
            ...({ 'Content-Type': 'application/json', 'Accept': 'application/json' }),
        },
        url: `${environment.apiBaseUrl}${req.url}`
    });
    return next(apiReq);
};
