Skip to content

Stupid simple REST API to list count of files with specified extension in specified directories.

Notifications You must be signed in to change notification settings

LeoVie/filecount-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

filecount-api

Stupid simple REST API to list count of files with specified extension in specified directories.

This does not include any error handling and security stuff, so please don't actually use this for any public-available endpoints. I've created this small tool to monitor some directory sizes and display them in my HomeAssistant instance.

How to run

  1. Build with Go go build
  2. Create filecount-api-config.json (see example below)
  3. Run filecount-api [PORT]
  4. Consume http://localhost:[PORT]

Example config

{
  "Directories": [
    {
      "Path": "/var/www/foo",
      "Extension": ".xml",
      "FriendlyName": "foo"
    },
    {
      "Path": "/var/www/foo/bar",
      "Extension": ".xml",
      "FriendlyName": "bar"
    }
  ]
}

Example response

{
  "DirectoriesCounts": {
    "foo": {
      "Count": 2
    },
    "bar": {
      "Count": 3
    }
  }
}

About

Stupid simple REST API to list count of files with specified extension in specified directories.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages