<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Go4WebDev</title>
    <description>The latest articles on DEV Community by Go4WebDev (@go4webdev).</description>
    <link>https://dev.to/go4webdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F708994%2Fc41600eb-64fe-4edd-bf96-954e8f2d6939.png</url>
      <title>DEV Community: Go4WebDev</title>
      <link>https://dev.to/go4webdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/go4webdev"/>
    <language>en</language>
    <item>
      <title>Creating a Simple PWA App using the Elephant Technique. Part 1</title>
      <dc:creator>Go4WebDev</dc:creator>
      <pubDate>Mon, 25 Dec 2023 18:40:34 +0000</pubDate>
      <link>https://dev.to/go4webdev/creating-a-simple-pwa-app-with-the-elephant-technique-part-1-5c8</link>
      <guid>https://dev.to/go4webdev/creating-a-simple-pwa-app-with-the-elephant-technique-part-1-5c8</guid>
      <description>&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;br&gt;
I have developed a desktop application using a RAD tool. Meaning that you can do almost everything in this tool. Carrying unnecessary baggage. Tons of magic but now and then it breaks when new OS arrives. To avoid this, I plan to move this app to the web. Having close to none experience of web development. This task is significant and may span several years. In this journey I will use the "elephant technique" in order to grasp an entire new technology. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why use the Elephant Technique?&lt;/strong&gt;&lt;br&gt;
First time I heard about the "Elephant Technique" was reading a tiny book from "&lt;a href="https://www.tmiaust.com.au/ideas_and_research/resources/elephant_technique.htm" rel="noopener noreferrer"&gt;Time Manager&lt;/a&gt;". Short it means that you can eat an elephant if you eat it bit by bit. To learn new things, this is a technique that I embrace. To break up an overwhelming task into small pieces.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Four Pillars I use to decide tools / methods
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Security&lt;/strong&gt;&lt;br&gt;
There are two types of security. The first is a "physical" safety. Like firewalls and other ways to hide assets. In my case I am testing the "secure vault technique". The second type is to make it harder to use, like encrypting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed&lt;/strong&gt; &lt;br&gt;
I prioritize speed. Not only because it is user friendly, but also being sustainable. Less space and less traffic reduces the environment impact.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sustainability&lt;/strong&gt;&lt;br&gt;
To base every single choice by its impact on the environment. Speed, footprint, memory consumption etc. Smaller and faster means "less resources". And even a simpler UI can increase the sustainability by reducing time for the user to navigate and get things done.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Simplicity&lt;/strong&gt;&lt;br&gt;
Simplicity has different layers. Developing, deploying, maintenance and even marketing. By using "magic extensions" you may make the development simpler, but all the magic can make it harder to maintain in the long run.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing tools
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Choose the main tool&lt;/strong&gt;. I did choose to give Go a Go as the foundation. Mainly because it is rather simple and very fast. Being compiled Go enhances security, sustainability, and speed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Then select auxiliary tools&lt;/strong&gt;. In my case it was obvious to use the "holy trinity". HTML, CSS and Javascript. And of course Postgresql as a military graded database. Known for its speed both for read and store. And its small footprint.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Select where to host&lt;/strong&gt;. I found that Debian on a VPS is easy to both deploy and maintain. For testing purpose I use IONOS VPS for 1GBP a month. And then using Webmin to manage the VPS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid using any form of frameworks&lt;/strong&gt; and external libraries. Frameworks introduce another layer of complexity to the vanilla languages.. Which means steeper learning curve and harder to maintain several extra syntaxes. Frameworks do a lot of magic at the cost of sustainability and speed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Selecting coding methods&lt;/strong&gt;. Like DRY, comment code and split up code into chunks. And make as dynamic and maintainable code as possible. Using variable and function names that is easy to understand. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Find coding buddies&lt;/strong&gt;. Forum I use is &lt;a href="http://forum.golangbridge.org" rel="noopener noreferrer"&gt;Go forum&lt;/a&gt; and &lt;a href="https://www.sitepoint.com/community/" rel="noopener noreferrer"&gt;Sitepoint&lt;/a&gt; for the web part. And Bard, chatGPT and phind are also good sparring partners.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Start developing
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTML Structure (9 MB)&lt;/strong&gt;&lt;br&gt;
At a fundamental 'Hello World' level, I've defined the layout's components, laying the foundation for future developments. but defined the parts of the layout, laying a foundation for further developments IMO. &lt;a href="https://tmpl1.go4webdev.org" rel="noopener noreferrer"&gt;Live preview here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Responsive (9 MB)&lt;/strong&gt;&lt;br&gt;
The next step is to find a layout that fits all screen from mobile to wide screens. &lt;a href="https://tmpl2.go4webdev.org" rel="noopener noreferrer"&gt;Live preview here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Navigation (9 MB)&lt;/strong&gt;&lt;br&gt;
I have found left navigation with 2 levels suitable for many cases. Two level of navigation is good for most users. &lt;a href="https://tmpl3.go4webdev.org" rel="noopener noreferrer"&gt;Live preview here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Theming (9 MB)&lt;/strong&gt;&lt;br&gt;
The ability to choose a theme is both to satisfy personal preferences and for usability for the disabled. &lt;a href="https://tmpl4.go4webdev.org" rel="noopener noreferrer"&gt;Live preview here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Language support (10 MB)&lt;/strong&gt;&lt;br&gt;
Language support can be achieved by many ways. In this case I added a function to the Go HTML template. So each sentence in the template is translated separately. &lt;a href="https://tmpl5.go4webdev.org" rel="noopener noreferrer"&gt;Live preview here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Master view / table (11 MB)&lt;/strong&gt;&lt;br&gt;
Basically get the scroll position and fetch next 100 rows of totally 25,000 records into the &lt;code&gt;&amp;lt;tbody&amp;gt;&lt;/code&gt; element. &lt;a href="https://tmpl6.go4webdev.org" rel="noopener noreferrer"&gt;Live preview here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Detail view / form (11 MB)&lt;/strong&gt;&lt;br&gt;
Master-Detail is a common way to select a table row and show the details. I discovered a technique that inserts a "sub page" into another page without reloading the entire page. &lt;a href="https://tmpl7.go4webdev.org" rel="noopener noreferrer"&gt;Live preview here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CRUD (11 MB)&lt;/strong&gt;&lt;br&gt;
To manage data (Create, Read, Update and Delete) using Postgresql, I call the database using REST call via an API. This detour is to increase safety and the speed as the connection to the database and credentials is done "internally" by a totally blocked servers. &lt;a href="https://tmpl8.go4webdev.org" rel="noopener noreferrer"&gt;Live preview&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PWA (11 MB)&lt;/strong&gt;&lt;br&gt;
PWA is an app that runs in a browser and looks like almost like a real app. The first challenge was to "override" the caching when using a multi-user app. The second challenge was to understand that only Chrome on Mac fully supports PWA automatic installations. Chrome on Windows, Edge and Safari only have "manual" installation. I have found no support for PWA in Firefox and Opera. &lt;a href="https://tmpl9.go4webdev.org" rel="noopener noreferrer"&gt;Live preview preferable running on Chrome&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqk21mnujel3wbg6femex.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqk21mnujel3wbg6femex.png" alt="Image description" width="800" height="558"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Part 2 - Login&lt;/strong&gt;
Next challenge is to do a safe login procedure. As safe as possible. Stay tuned...&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;VPS&lt;/strong&gt;&lt;br&gt;
All 9 steps are hosted on a 1 GBP per month server from &lt;a href="http://aklam.io/ygn3RF" rel="noopener noreferrer"&gt;IONOS&lt;/a&gt;. The final compiled executable is only 11 MB. All images, scripts, pages etc included. &lt;/p&gt;

&lt;p&gt;I welcome feedback on whether my approach is on the right track or suggestions for alternative methods.&lt;/p&gt;

</description>
      <category>challenge</category>
      <category>go</category>
    </item>
    <item>
      <title>Embed Chart.js in Go</title>
      <dc:creator>Go4WebDev</dc:creator>
      <pubDate>Wed, 11 Oct 2023 06:06:38 +0000</pubDate>
      <link>https://dev.to/go4webdev/using-chartjs-and-go-2p6</link>
      <guid>https://dev.to/go4webdev/using-chartjs-and-go-2p6</guid>
      <description>&lt;p&gt;My goals with this "chart demo" was to &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Find a solution that can use local API on the server.&lt;/li&gt;
&lt;li&gt;Make it as fast as possible.&lt;/li&gt;
&lt;li&gt;Work more dynamically using JSON.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Normally you use Javascript fetch() in the browser and hence have to use a "public" API to get data from the database. Creating the charts on the server makes it possible to use "hidden" API requests. This makes it both safer and faster.&lt;/p&gt;

&lt;p&gt;Chart.js is one of the smallest Javascript chart libraries available (as far as I know) - about 60KB. So in order to load faster I skipped the CDN part and downloaded it to my server. To further increase the speed I embedded Chart.js into the Go binary.&lt;/p&gt;

&lt;p&gt;The ability to fetch JSON from within Go and populate the chart before rendering also makes it more dynamic and way safer than fetch() in the browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://chart.go4webdev.org/home" rel="noopener noreferrer"&gt;Here is my attempt to make charts faster using Go&lt;/a&gt;. I welcome any clue how to make it even faster.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Flicker free HTML forms using Go templates</title>
      <dc:creator>Go4WebDev</dc:creator>
      <pubDate>Sun, 20 Aug 2023 15:30:44 +0000</pubDate>
      <link>https://dev.to/go4webdev/ssr-hybrid-method-for-html-forms-using-go-templates-192b</link>
      <guid>https://dev.to/go4webdev/ssr-hybrid-method-for-html-forms-using-go-templates-192b</guid>
      <description>&lt;p&gt;When it comes to creating and populating HTML forms, there are many choices. The pivotal question: Should the form be crafted on the server or the client side? After some considerations, I've chosen a different approach. Something like "SSR Hybrid method."&lt;/p&gt;

&lt;p&gt;How It Works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Go render a HTML template form.&lt;/li&gt;
&lt;li&gt;During the rendering, data injected into the form. &lt;/li&gt;
&lt;li&gt;Labels are translated to the user's language.&lt;/li&gt;
&lt;li&gt;The page is then send to memory buffer&lt;/li&gt;
&lt;li&gt;Injected into the HTML body.&lt;/li&gt;
&lt;li&gt;The form is fetched and integrated into the innerHTML.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Go func that make this possible sending REST string from  Javascript fetch() &lt;strong&gt;tsk/view/1&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// write form to buffer an send to html body
func get_card(w http.ResponseWriter, module string, mode string, val string) {
    page := module + "_" + mode // form name
    data := json2map4id(module, val) // call the API
    var buf bytes.Buffer 
    tpl.ExecuteTemplate(&amp;amp;buf, page, data) // Render to buffer
    fmt.Fprint(w, buf.String()) // write to html body
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Benefits of the SSR Hybrid Approach:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Safety&lt;/strong&gt; The hybrid approach enhances security by reducing exposure of APIs to the internet directly, thanks to Go's compiled nature.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speed &amp;amp; Flicker-Free Experience&lt;/strong&gt; By optimizing initial page load times with Server-Side Rendering and subsequently employing JavaScript for seamless updates, users experience fast interactions without flickers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maintenance Simplified&lt;/strong&gt; Combining related forms into single HTML templates streamlines maintenance and curbs complexity, even as your project grows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Translation&lt;/strong&gt; Go's HTML templating makes multilingual support simpler. All translations are handled server-side, ensuring global accessibility.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Seamless Form Switching&lt;/strong&gt; The hybrid technique facilitates dynamic switches between forms, delivering a polished and uninterrupted user journey.&lt;/p&gt;

&lt;p&gt;Check the &lt;a href="//form.go4webdev.org/howto"&gt;"SSR Hybrid method" here&lt;/a&gt; in action. Code snippets attached.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>go</category>
    </item>
    <item>
      <title>Static 2 level menu in Go</title>
      <dc:creator>Go4WebDev</dc:creator>
      <pubDate>Sun, 16 Jul 2023 20:15:00 +0000</pubDate>
      <link>https://dev.to/go4webdev/static-2-level-menu-in-go-4kg8</link>
      <guid>https://dev.to/go4webdev/static-2-level-menu-in-go-4kg8</guid>
      <description>&lt;p&gt;&lt;strong&gt;Navigation in General&lt;/strong&gt;&lt;br&gt;
When it comes to designing navigation menus, it's generally recommended to keep the levels of depth to a minimum for optimal user-friendliness. &lt;/p&gt;

&lt;p&gt;In my experience, a maximum of two levels deep provides a user-friendly navigation experience and reduces the chances of confusion or getting lost. &lt;/p&gt;

&lt;p&gt;A mobile-first approach ensures that the navigation remains user-friendly across different devices and screen sizes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using Go HTML Templates&lt;/strong&gt;&lt;br&gt;
By using Go HTML templates, you can simplify the process of creating navigation menus. Go templates are a powerful feature of the Go language that allows for the creation of HTML pages. &lt;/p&gt;

&lt;p&gt;Instead of hard-coding navigation elements into each individual page, you can define a single navigation sub-template that is shared across the entire site. &lt;/p&gt;

&lt;p&gt;Go templates provide many functions that enhance the flexibility of navigation implementation. Templating functions like "if" enable you to conditionally render navigation elements based on parameters. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://nav.go4webdev.org" rel="noopener noreferrer"&gt;In this micro guide&lt;/a&gt;, I will show you how I created a static two-level menu navigation using Go templates.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>go</category>
      <category>nav</category>
    </item>
    <item>
      <title>Translations on-the-fly using Go</title>
      <dc:creator>Go4WebDev</dc:creator>
      <pubDate>Sun, 30 Apr 2023 06:14:44 +0000</pubDate>
      <link>https://dev.to/go4webdev/language-on-the-fly-using-go-363</link>
      <guid>https://dev.to/go4webdev/language-on-the-fly-using-go-363</guid>
      <description>&lt;p&gt;There are several methods to make a Go web app "multilingual". I chose to store the translations in .po files. One language per file.&lt;/p&gt;

&lt;p&gt;The Go html template looks like this: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;p&amp;gt;{{trans "Company"}}&amp;lt;/p&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This means that the html template calls a &lt;code&gt;func trans()&lt;/code&gt; and translates "Company" into the set language.&lt;/p&gt;

&lt;p&gt;The html template is translated by Go web server before the page is rendered without noticeable delay.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://lang.go4webdev.org" rel="noopener noreferrer"&gt;Here is both an example and the code behind.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>go</category>
    </item>
    <item>
      <title>How to call a function from within a Go html template</title>
      <dc:creator>Go4WebDev</dc:creator>
      <pubDate>Wed, 29 Mar 2023 15:40:31 +0000</pubDate>
      <link>https://dev.to/go4webdev/how-to-call-a-function-from-within-a-go-html-template-4fme</link>
      <guid>https://dev.to/go4webdev/how-to-call-a-function-from-within-a-go-html-template-4fme</guid>
      <description>&lt;p&gt;Using Go for web development is not that common, but I find it rather simple to create static web sites and the site often will be faster than other tools like Drupal, Wordpress and PHP. &lt;/p&gt;

&lt;p&gt;Web development using Go means that you use at least 3 other “languages”. HTML, CSS and Javascript. The challenge is to get these languages to “talk” to each other. It is rather trivial to put data in a Go html template, but sometimes you want the HTML template to call a function in Go.&lt;/p&gt;

&lt;p&gt;This is of course possible, but all sources I have found do not explain this in a simple way. The Go documentation is not that friendly to a newbie. And almost all examples on the net are either at “hello world” level OR too complicated.&lt;/p&gt;

&lt;p&gt;Finally I found a solution by using 3 simple steps. Hope this will help somebody that also has been struggling with this.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Write the HTML and call the function with parameters.&lt;/li&gt;
&lt;li&gt;Tell the templates to use this function.&lt;/li&gt;
&lt;li&gt;Finally create the desired &lt;strong&gt;func&lt;/strong&gt; in Go.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Using Funcs in HTML you can do a lot of things in a HTML template.&lt;/p&gt;

&lt;p&gt;Here is the code and live preview &lt;a href="https://funcs.go4webdev.org" rel="noopener noreferrer"&gt;https://funcs.go4webdev.org&lt;/a&gt;&lt;/p&gt;

</description>
      <category>go</category>
    </item>
    <item>
      <title>Switch dynamically between multiple Themes using plain CSS and vanilla Javascript</title>
      <dc:creator>Go4WebDev</dc:creator>
      <pubDate>Fri, 16 Sep 2022 08:21:22 +0000</pubDate>
      <link>https://dev.to/go4webdev/switch-between-multiple-themes-using-plain-css-and-vanilla-javascript-4h1c</link>
      <guid>https://dev.to/go4webdev/switch-between-multiple-themes-using-plain-css-and-vanilla-javascript-4h1c</guid>
      <description>&lt;p&gt;There are tons of "theming" ways out there. But I found them either too simple or too complicated. Or using a "plugin" of some sort. Close to nothing using plain HTML, CSS and Javascript.&lt;/p&gt;

&lt;p&gt;The challenges with theming I found was:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Switching between multiple themes&lt;/li&gt;
&lt;li&gt;Saving the theme settings locally&lt;/li&gt;
&lt;li&gt;Make it as simple as possible (but not simpler)&lt;/li&gt;
&lt;li&gt;Include svg icons in theming&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The method I use was to &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Put the theme in a dataset in the body tag&lt;/li&gt;
&lt;li&gt;Save this setting in localStorage&lt;/li&gt;
&lt;li&gt;Using CSS variables connected to the body tag&lt;/li&gt;
&lt;li&gt;Saving svg icons as "symbol" to make it dynamic&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In &lt;a href="https://theme.go4webdev.org" rel="noopener noreferrer"&gt;this micro site&lt;/a&gt; you can see the result. The main parts of the code behind is also included. &lt;/p&gt;

&lt;p&gt;Comments and suggestions for improvements are welcome&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>html</category>
      <category>go</category>
    </item>
    <item>
      <title>Hosting Several Go sites on one VPS</title>
      <dc:creator>Go4WebDev</dc:creator>
      <pubDate>Wed, 22 Sep 2021 18:15:44 +0000</pubDate>
      <link>https://dev.to/go4webdev/hosting-several-go-sites-on-one-vps-16kk</link>
      <guid>https://dev.to/go4webdev/hosting-several-go-sites-on-one-vps-16kk</guid>
      <description>&lt;p&gt;&lt;a href="https://hosting.go4webdev.org/howto" rel="noopener noreferrer"&gt;https://hosting.go4webdev.org/howto&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hosting MANY Go executables is different from hosting PHP or similar. You have to set the Go to listen to different ports. And then tell Nginx proxy (redirect) which Go executable to open. This mini tutorial guides you how to set up a VPS and create a "Go Hosting".&lt;/p&gt;

&lt;p&gt;Webmin is a tool to manage the entire VPS Host. Amongst other things, upload, config and monitor.&lt;/p&gt;

&lt;p&gt;By using Cloudflare in front as an extra proxy you can add several cool things. Amongst others can Cloudflare handle the SSL certificate for your entire server if you want. The sites are cached automatically and if you want Cloudflare can compress your code for faster rendering.&lt;/p&gt;

&lt;p&gt;When adding systemd support to each Go executable you make it simpler to restart Go. Both manually and automatically.&lt;/p&gt;

&lt;p&gt;If you host only ONE Go executable, there is no need for Nginx. Just use port 80 and 443 as usual.&lt;/p&gt;

</description>
      <category>go</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Website by Go</title>
      <dc:creator>Go4WebDev</dc:creator>
      <pubDate>Mon, 20 Sep 2021 09:31:24 +0000</pubDate>
      <link>https://dev.to/go4webdev/website-by-go-4jkn</link>
      <guid>https://dev.to/go4webdev/website-by-go-4jkn</guid>
      <description>&lt;p&gt;I have run a couple of Drupal and WordPress sites for several years. I always had a hard time understanding the logic behind these tools as soon as I could do anything but add a plugin. &lt;/p&gt;

&lt;p&gt;So it was refreshing to test Go to create a website. Go html templates have a touch of Angular and an ounce of React, but way simpler and above all faster.&lt;/p&gt;

&lt;p&gt;I still consider myself as a beginner both using Go and Web developing. The Go part of this website is about 10 MB of compiled code replacing both Apache, Nginx and frameworks.&lt;/p&gt;

&lt;p&gt;As there are a few tutorials about Go as a web "framework", I decided to document my efforts. And the result is in this mini tutorial: &lt;a href="https://static.go4webdev.org" rel="noopener noreferrer"&gt;https://static.go4webdev.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any feedback is welcome!&lt;/p&gt;

</description>
      <category>go</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
