Git Product home page Git Product logo

image-logger's Introduction

๐Ÿ–ผ๏ธ Image Logger

๐Ÿ“ Description

This is a simple image logger that logs images to a file and sending them to a discord webhook.

๐Ÿ“š How to use

๐Ÿ“ฆ Requirements

  • Node.js v20.0.0 or higher
  • NPM v7.0.0 or higher
  • PNPM v6.0.0 or higher

๐Ÿ“ฅ Installation

pnpm install

โš™๏ธ Configuration

Create 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 Dockerfile

and 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.json as you want.

๐Ÿ–ผ๏ธ Preparing images

  1. Create a folder called assets or whatever you want in the src folder.
  2. Add your images to the folder.
  3. Add the images path to the config.json file.

๐Ÿ“ Post Image

You can POST images to the /image endpoint.

๐ŸšŒ Deploying

๐Ÿ’ป Local

pnpm start

๐Ÿณ Docker

docker compose up -d

โ–ฒ Vercel

You can using the Vercel platform to deploy this project.

Note: Don't forget to add the config and image to the project before deploying.

๐Ÿ“ API

๐Ÿ–ผ๏ธ Post Image

curl -X POST -H "Content-Type: application/json" -d '{"image": "IMAGE URL", "imageName": "IMAGE NAME"}' http://localhost:3000/image

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

image-logger's People

Contributors

pungrumpy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.