feat: Add pino-pretty logging and update SunoApi methods

Introduce pino-pretty for improved logging and update SunoApi methods to
incorporate new functionalities for generating custom audios, retrieving
audio information, and obtaining credit details. The new pino-pretty
logging enhances readability and provides better insights into
application behavior. These changes align with the broader goal of
enhancing developer experience and maintaining application stability.

#N/A
This commit is contained in:
blueeon
2024-03-28 11:50:10 +08:00
parent 0fcf77df6d
commit 2a309f87a7
4 changed files with 132 additions and 39 deletions
+2 -2
View File
@@ -5,10 +5,10 @@ export async function GET(req: NextRequest) {
if (req.method === 'GET') {
try {
// 调用 SunoApi.get_limit 方法获取剩余的信用额度
const limit = await SunoApi.get_limit();
const limit = await SunoApi.get_credits();
// 使用 NextResponse 构建成功响应
return new NextResponse(JSON.stringify({ limit }), {
return new NextResponse(JSON.stringify(limit), {
status: 200,
headers: { 'Content-Type': 'application/json' }
});