-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from WodenWang820118/develop
feat: migrate to pnpm
- Loading branch information
Showing
15 changed files
with
90,502 additions
and
22,145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
'use strict'; | ||
const { writeFileSync } = require('fs'); | ||
const { appendFileSync } = require('fs'); | ||
const { join } = require('path'); | ||
|
||
function writePath(filePath, content) { | ||
writeFileSync(filePath, content, 'utf8'); | ||
function logToFile(path, message, type = 'info') { | ||
const logPath = join(path, `${type}.log`); | ||
const timestamp = new Date().toISOString(); | ||
const logMessage = `${timestamp} - ${type.toUpperCase()}: ${message}\n`; | ||
|
||
try { | ||
appendFileSync(logPath, logMessage); | ||
} catch (error) { | ||
console.error('Failed to write to log file:', error); | ||
} | ||
} | ||
|
||
module.exports = { | ||
writePath, | ||
logToFile, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Controller, Get } from '@nestjs/common'; | ||
|
||
@Controller('health') | ||
export class HealthController { | ||
@Get() | ||
check() { | ||
return { | ||
status: 'ok', | ||
message: 'Backend is up and running', | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { HealthController } from './health.controller'; | ||
|
||
@Module({ | ||
controllers: [HealthController], | ||
}) | ||
export class HealthModule {} |
Oops, something went wrong.