nsfwjs wrapper as express server written in typescript.
See example environment variables in .env.template
, all are optional.
JPEG, JPG, and PNG are accepted. Server will automatically convert to PNG using sharp.
Reminder to set NODE_ENV
environment variable to production
when running in production.
Code 401
{
"message": "unauthorized"
}
Code 400
{
"message": "missing image"
}
Code 500
{
"message": "server error"
}
Code 200
Float 1-0 = 100% and 0% confidence respectively
{
"message": "success",
"probabilities": {
"Hentai": 0.00000000000000001,
"Drawing": 0.00000000000000001,
"Porn": 0.00000000000000001,
"Sexy": 0.00000000000000001,
"Neutral": 0.00000000000000001
}
}