add helloworld API endpoint for product module with test case

This commit is contained in:
louiscklaw
2025-06-15 13:54:35 +08:00
parent 08642a2bf6
commit c1b71fca64
2 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import type { NextRequest, NextResponse } from 'next/server';
import { STATUS, response, handleError } from 'src/utils/response';
/**
***************************************
* GET - helloworld
***************************************
*/
export async function GET(req: NextRequest, res: NextResponse) {
try {
return response({ helloworld: 'product' }, STATUS.OK);
} catch (error) {
return handleError('Helloworld - Get all', error);
}
}

View File

@@ -0,0 +1,4 @@
###
GET /api/product/helloworld HTTP/1.1
Host: localhost:7272