Tuesday, April 22, 2025
HomeGolangThe best way to develop static web site from golang - Getting...

The best way to develop static web site from golang – Getting Assist


The best way to develop static web site from golang. It ought to be server aspect. And it ought to name api too.

Principally you possibly can work with conventional MPA (every web page loaded totally – higher for search engine optimization) or SPA (Only one most important web page is totally loaded and the opposite pages are “injected” into this most important template. Smaller and sooner)

I exploit MPA for websites and SPA for internet apps.

  1. Use plain Go HTML templates. No framework wanted.
  2. Use internet server as endpoints that serves the pages
  3. You solely want API if you wish to add dynamic information into the templates
  4. Use //embed to create a single executable and add to a VPS
  5. Use Cloudflare for DNS, caching and many others…

Your query is just too broad to present an in depth reply IMO.

Right here is the easiest doable “Go website” with out templates. And right here is my first static website (considerably outdated MPA) that describes elements of my journey. My first try to know SPA. (utilizing Go to render and Javascript to inject)

“Static web site” and “ought to name API” don’t compose properly in my head…

As “static web site” means “one thing that by no means adjustments” and “ought to name API” means “shall retrieve exterior info and mirror that on the web site”.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments