Skip to content

Commit

Permalink
Merge pull request #40 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 991d6d7 + 0370563 commit e7c3caa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
15 changes: 2 additions & 13 deletions apps/client/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { existsSync } from 'node:fs';
import { join } from 'node:path';
import bootstrap from './src/main.server';

// The Express app is exported so that it can be used by serverless Functions.

export function app(): express.Express {
const server = express();
const distFolder = join(process.cwd(), 'dist/apps/client/browser');
Expand All @@ -20,17 +20,6 @@ export function app(): express.Express {
server.set('view engine', 'html');
server.set('views', distFolder);

// Example Express Rest API endpoints
// server.get('/api/**', (req, res) => { });
// Serve static files from /browser
server.get(
'*.*',
express.static(distFolder, {
maxAge: '1y',
})
);

// 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}`);
Expand All @@ -44,7 +33,7 @@ export function app(): express.Express {
publicPath: distFolder,
providers: [
{ provide: APP_BASE_HREF, useValue: baseUrl },
{ provide: 'API_URL', useValue: process.env.API_URL }
{ provide: 'API_URL', useValue: process.env['API_URL'] + '/api/v1' },
],
})
.then((html) => res.send(html))
Expand Down
4 changes: 3 additions & 1 deletion apps/client/src/app/shared/api-client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import { environment } from '../../environments/environment';
export class ApiClientService {
private baseUrl = environment.apiUrl;

constructor(private http: HttpClient, private tokenService: TokenService) {}
constructor(private http: HttpClient, private tokenService: TokenService) {

}

private getHeaders(): HttpHeaders {
const token = this.tokenService.getToken();
Expand Down

0 comments on commit e7c3caa

Please sign in to comment.