Skip to content

Basic example of golang based website with live reload functionality

License

Notifications You must be signed in to change notification settings

emcode/go-live-reload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go live reload

This is minimal example of server side rendered website written in golang that has live auto-reload - meaning: whenever you change the go code or html template code, website will reload automatically in the web browser.

It works by using Server Sent Events and watchexec utility.

dependencies

Install locally:

  • go compiler
  • watchexec: utility for watching filesystem
  • just: make replacement

how to run

To build and run the website in watch mode execute in your terminal:

just serve

In web browser go to: http://localhost:8080

Then change the code and see website refreshing by itself.