Skip to content

Commit

Permalink
Merge pull request #38 from JuribaDev/hotfix
Browse files Browse the repository at this point in the history
hotfix
  • Loading branch information
JuribaDev authored Aug 31, 2024
2 parents 56b513d + 893c0bc commit 924df8d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
13 changes: 13 additions & 0 deletions apps/client/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ http {

location / {
try_files $uri $uri/ /index.html;
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT' always;
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE, PUT' always;
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Accept, Authorization' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
}

location ~* ^(?!/assets/).*$ {
Expand Down
6 changes: 6 additions & 0 deletions apps/client/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "apps/client/src/environments/environment.ts",
"with": "apps/client/src/environments/environment.prod.ts"
}
],
"budgets": [
{
"type": "initial",
Expand Down
2 changes: 2 additions & 0 deletions apps/client/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export function app(): express.Express {
// All regular routes use the Angular engine
server.get('*', (req, res, next) => {
const { protocol, originalUrl, baseUrl, headers } = req;
console.log(`SSR request: ${protocol}://${headers.host}${originalUrl}`);


commonEngine
.render({
Expand Down
2 changes: 2 additions & 0 deletions apps/client/src/app/shared/api-client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export class ApiClientService {

// Auth endpoints
login(loginData: LoginRequestDto): Observable<AuthResponseDto> {
console.log(`Making login request to: ${this.baseUrl}/auth/login`);

return this.http.post<AuthResponseDto>(`${this.baseUrl}/auth/login`, loginData);
}

Expand Down
2 changes: 1 addition & 1 deletion apps/client/src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const environment = {
production: true,
apiUrl: '/api/v1'
apiUrl: typeof window !== 'undefined' ? window.location.origin + '/api/v1' : '${API_URL}/api/v1'
};

0 comments on commit 924df8d

Please sign in to comment.