add helloworld API endpoint for product module with test case
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,4 @@
|
|||||||
|
###
|
||||||
|
GET /api/product/helloworld HTTP/1.1
|
||||||
|
Host: localhost:7272
|
||||||
|
|
Reference in New Issue
Block a user