{"id":15631301,"url":"https://github.com/markbates/refresh","last_synced_at":"2025-04-13T00:47:32.133Z","repository":{"id":10031551,"uuid":"64153802","full_name":"markbates/refresh","owner":"markbates","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-26T15:25:47.000Z","size":155,"stargazers_count":195,"open_issues_count":14,"forks_count":32,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-13T00:47:20.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markbates.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"markbates","patreon":"buffalo"}},"created_at":"2016-07-25T17:20:31.000Z","updated_at":"2025-03-11T10:16:59.000Z","dependencies_parsed_at":"2023-02-14T18:46:38.805Z","dependency_job_id":null,"html_url":"https://github.com/markbates/refresh","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbates%2Frefresh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbates%2Frefresh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbates%2Frefresh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markbates%2Frefresh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markbates","download_url":"https://codeload.github.com/markbates/refresh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650434,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T10:39:54.042Z","updated_at":"2025-04-13T00:47:32.099Z","avatar_url":"https://github.com/markbates.png","language":"Go","funding_links":["https://github.com/sponsors/markbates","https://patreon.com/buffalo"],"categories":[],"sub_categories":[],"readme":"# Refresh\n\n## Rebuild and re-run your Go applications when files change.\n\nThis project was inspired by [https://github.com/pilu/fresh](https://github.com/pilu/fresh). The lack of updates and response from the maintainer, non-idiomatic codebase, numerous bugs, and lack of detailed reporting made the project a dead end for me to use. Enter `refresh`.\n\nThis simple command line application will watch your files, trigger a build of your Go binary and restart the application for you.\n\n## Installation\n\n```\n$ go get github.com/markbates/refresh\n```\n\n## Getting Started\n\nFirst you'll want to create a `refresh.yml` configuration file:\n\n```\n$ refresh init\n```\n\nIf you want the config file in a different directory:\n\n```\n$ refresh init -c path/to/config.yml\n```\n\nSet it up the way you want, but I believe the defaults really speak for themselves, and will probably work for 90% of the use cases out there.\n\n## Usage\n\nOnce you have your configuration all set up, all you need to do is run it:\n\n```\n$ refresh run\n```\n\nThat's it! Now, as you change your code the binary will be re-built and re-started for you.\n\n## HTTP Handler\n\nRefresh is nice enough to ship with an `http.Handler` that you can wrap around your requests. Why would you want to do that?\nWell, if there is an error doing a build, the built in `http.Handler` will print the error in your browser in giant text so you'll know that there was a problem, and where to fix it (hopefully).\n\n```go\n...\nm := http.NewServeMux()\nerr = http.ListenAndServe(\":3000\", web.ErrorChecker(m))\n...\n```\n\n## Configuration Settings\n\n```yml\n# The root of your application relative to your configuration file.\napp_root: .\n# List of folders you don't want to watch. The more folders you ignore, the \n# faster things will be.\nignored_folders:\n  - vendor\n  - log\n  - tmp\n# List of file extensions you want to watch for changes.\nincluded_extensions:\n  - .go\n# The directory you want to build your binary in.\nbuild_path: /tmp\n# `fsnotify` can trigger many events at once when you change a file. To minimize\n# unnecessary builds, a delay is used to ignore extra events.\nbuild_delay: 200ms\n# If you have a specific sub-directory of your project you want to build.\nbuild_target_path : \"./cmd/cli\"\n# What you would like to name the built binary.\nbinary_name: refresh-build\n# Extra command line flags you want passed to the built binary when running it.\ncommand_flags: [\"--env\", \"development\"]\n# Extra environment variables you want defined when the built binary is run.\ncommand_env: [\"PORT=1234\"]\n# If you want colors to be used when printing out log messages.\nenable_colors: true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkbates%2Frefresh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkbates%2Frefresh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkbates%2Frefresh/lists"}