| 
									
										
										
										
											2023-08-10 17:55:04 +00:00
										 |  |  | import express from "express"; | 
					
						
							| 
									
										
										
										
											2023-08-10 18:36:32 +00:00
										 |  |  | import bodyParser from "body-parser"; | 
					
						
							| 
									
										
										
										
											2023-08-10 17:55:04 +00:00
										 |  |  | const app = express() | 
					
						
							|  |  |  | const port = 4000 | 
					
						
							| 
									
										
										
										
											2023-08-10 18:36:32 +00:00
										 |  |  | app.use(bodyParser.json()) | 
					
						
							|  |  |  | app.post('/api', (req,res) => { | 
					
						
							|  |  |  |     console.log("webhook received:") | 
					
						
							|  |  |  |     console.dir(req.body.body.note.text) | 
					
						
							|  |  |  |     res.sendStatus(200) | 
					
						
							| 
									
										
										
										
											2023-08-10 17:55:04 +00:00
										 |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | app.listen(port, () => { | 
					
						
							|  |  |  |     console.log(`listening on port ${port}`) | 
					
						
							|  |  |  | }) |