File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ export function getHealthzHandler() {
8
8
9
9
export function postNotificationHandler ( ) {
10
10
return async ( req : Request , res : Response ) => {
11
- res . json ( { message : 'postNotificationHandler()' } ) ;
11
+ console . log ( req . body ) ;
12
+ res . json ( { message : 'ok' } ) ;
12
13
} ;
13
14
}
Original file line number Diff line number Diff line change
1
+ async function main ( ) {
2
+ try {
3
+ const response = await fetch ( 'http://localhost' , {
4
+ method : 'POST' ,
5
+ headers : {
6
+ 'Content-Type' : 'application/json' ,
7
+ 'X-API-Key' : '42069247355' ,
8
+ } ,
9
+ body : JSON . stringify ( {
10
+ id : 69 ,
11
+ message : 'Hello, this is a test message' ,
12
+ details : {
13
+ name : 'John Doe' ,
14
+ age : 30 ,
15
+ email : 'john.doe@example.com' ,
16
+ } ,
17
+ } ) ,
18
+ } ) ;
19
+
20
+ const data = await response . json ( ) ;
21
+ console . log ( data ) ;
22
+ } catch ( error ) {
23
+ console . error ( 'Error:' , error ) ;
24
+ }
25
+ }
26
+
27
+ main ( ) ;
You can’t perform that action at this time.
0 commit comments