Skip to content

Commit

Permalink
fix(api-server): debug issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadhonarvar authored and alimd committed Nov 7, 2024
1 parent 27d8166 commit a3ef40f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/api-server/src/api-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,12 @@ export class NanotronApiServer {
}

protected defineHealthRoute_(): void {
this.logger_.logMethod?.('defineHealthRoute_');

this.defineRoute({
method: 'GET',
url: '/health',
handler: function () {
this.logger_.logMethod?.('defineHealthRoute_');
const res = this.serverResponse.raw_;
res.statusCode = HttpStatusCodes.Success_200_OK;
res.setHeader('server', 'Alwatr Nanotron');
Expand All @@ -308,12 +309,13 @@ export class NanotronApiServer {
}

protected defineCorsRoute_(): void {
this.logger_.logMethod?.('defineCorsRoute_');

this.defineRoute({
method: 'OPTIONS',
matchType: 'startsWith',
url: '/',
handler: function () {
this.logger_.logMethod?.('defineCorsRoute_');
const res = this.serverResponse.raw_;
res.statusCode = HttpStatusCodes.Success_204_No_Content;
res.setHeader('access-control-allow-origin', '*');
Expand Down

0 comments on commit a3ef40f

Please sign in to comment.