This is a simple image logger that logs images to a file and sending them to a discord webhook.
- Node.js v20.0.0 or higher
- NPM v7.0.0 or higher
- PNPM v6.0.0 or higher
pnpm installCreate a config.json you can use the config.example.json as a template.
{
"webhooks": [
{
"name": "NAME OF WEBHOOK",
"url": "URL OF WEBHOOK"
}
],
"image": [
{
"name": "NAME OF IMAGE",
"path": "URL OF IMAGE or PATH OF IMAGE" // src/assets/IMAGE_NAME.png
},
{
"name": "NAME OF IMAGE",
"path": "URL OF IMAGE or PATH OF IMAGE" // src/assets/IMAGE_NAME.png
}
]
}You can also use enviroment variables to configure the project.
HEALTHCHECK_USER_AGENT=USER AGENT FOR HEALTHCHECK # Edit on Dockerfileand then update your environment variables on your machine.
export HEALTHCHECK_USER_AGENT="USER AGENT FOR HEALTHCHECK"Note: You can add as webhooks url on
config.jsonas you want.
- Create a folder called
assetsor whatever you want in the src folder. - Add your images to the folder.
- Add the images path to the
config.jsonfile.
You can POST images to the /image endpoint.
pnpm startdocker compose up -dYou can using the Vercel platform to deploy this project.
Note: Don't forget to add the
configandimageto the project before deploying.
curl -X POST -H "Content-Type: application/json" -d '{"image": "IMAGE URL", "imageName": "IMAGE NAME"}' http://localhost:3000/imageThis project is licensed under the MIT License - see the LICENSE file for details.