clearInterval(interval);// Stop the interval once the message is fully streamed
res.end();// End the response
}
},500);// Send a word every 1 second
}
elseif(req.url==='/search'&&req.method==='POST'){
res.status(200).json(
[
{
"text":"\n\n/api/answer\nIt's a POST request that sends a JSON in body with 4 values. It will receive an answer for a user provided question.\n",
"title":"API-docs.md"
},
{
"text":"\n\nOur Standards\n\nExamples of behavior that contribute to a positive environment for our\ncommunity include:\n* Demonstrating empathy and kindness towards other people\n",