A rest service to validate/moderate comments or feedback submitted by users.
npm install
Update .env
file to change these environment variables.
- SERVER_PORT
- BAD_WORDS
- GOOD_WORDS
node server.js
Get api details
GET /api HTTP/1.1
Host: localhost:<SERVER_PORT>
{
"validate": {
"link": "http://localhost:3000/api/validate",
"method": "POST",
"description": "to validate a comment or feedback"
},
"moderate": {
"link": "http://localhost:3000/api/moderate",
"method": "POST",
"description": "to moderate a comment or feedback"
}
}
Validate a comment
POST /api/validate HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:<SERVER_PORT>
{
"comment" : "your comment here"
}
{
"comment" : "your comment here",
"valid": "true | false"
}
Moderate a comment
POST /api/moderate HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:<SERVER_PORT>
{
"comment" : "your comment here"
}
{
"comment" : "your comment here",
"moderated_comment": "moderate comment here"
}