codegangsta / gin

Live reload utility for Go web servers
MIT License
4.23k stars 317 forks source link

Restart when template files were edited #44

Open runemadsen opened 9 years ago

runemadsen commented 9 years ago

Right now gin only listens to .go files, which requires me to restart the server to see changes to .html files. It might be useful to be able to specify extra file extension to watch.

joshkamau commented 9 years ago

+1

bikbah commented 9 years ago

+1

534N commented 9 years ago

+1

bcspragu commented 9 years ago

My (albeit barbaric) solution was fork the repo and check if the extension is .go or .html, and I use that binary instead.

https://github.com/bcspragu/gin/commit/4f3b70d3b27a5685428592b96af622d4a15350f4

gobijan commented 9 years ago

@bcspragu: very useful addition. make a pull request?

bcspragu commented 9 years ago

In it's current state, it's too specific. I'll turn it into a command line flag that takes a list of extensions to allow, and I'll make a pull request of that.

drewwells commented 9 years ago

A better approach would allow some cli arguments. @codeskyblue does a really good job with a JSON config file: https://github.com/codeskyblue/fswatch/blob/master/fswatch.go#L231

kmulvey commented 9 years ago

+1

codeskyblue commented 9 years ago

thanks @drewwells for using fswatch. Use a config file like json is very useful when monitor is complex, I have been using this way for a long time.

bravadomizzou commented 9 years ago

+1