Saturday, May 18, 2024
HomeGolangDeploy a go backend to web-hoster? - Getting Assist

Deploy a go backend to web-hoster? – Getting Assist


Hello,
Sorry for the essential query. I’m a complete noob. In go and another language.
Can I deploy a go backend to a daily web-hoster? I imply, for instance the hoster I exploit permits cases of assorted CMSs and clearly PHP code. I solely see this as a result of the PHP model is a really outstanding setting in my webspace.
How about go? Can this run on a daily webserver?

Background: I’d like to begin studying programming. For some causes I’d favor to take action in go. I’m not tremendous occupied with programming net stuff, however “sadly” the one precise usecase I presently have is a webpage with some DB performance within the background. And since I discovered that studying programming with out an precise downside in thoughts is futile, this may be me first venture.

Thanks upfront!

When you have root entry it ought to be potential. However I suppose that you’ll have to use a VPS or related.

Hmm, positive, however this sounds to me like I’d be putting in an utility on a digital linux server, not likely one thing on an internet server. Am I mixing up issues?

What host are you planning on utilizing? That is an extremely broad query, like “how do I constructed an app?”. I might hone in on what you’re making an attempt to construct, and the place you need to deploy it, then begin asking particular questions. Listed below are a number of concepts although:

1 Like

Sorry, perhaps I’m expressing myself not properly sufficient (I’m not native English. I’ve good understanding of know-how, however zero programming expertise – but) Let me strive once more:
My present supplier helps PHP. I add the web site’s information, HTML and likewise .PHP information and the web site simply “runs”.
AFAIK that is additionally the case with a self-hosted Apache server. It simply “understands” PHP.

Are there suppliers which help go in the identical means?
I had a fast take a look at Vultr and at first look this seems to be prefer it’s a Cloud host. So I lease a slice of an working system and might make it do something, together with deciphering go. However AFAIK this can be a completely completely different factor and far more expensive than simply purchase some webspace.

The aim of my query is just to search out out, if this web site (a re-write of our outdated Choir web page) is a worthy first venture and go is right for it, or if such issues are nonetheless higher written in PHP. Then I’d simply search for one thing else to begin with.

Not fairly to my data, however you may get one thing KIND of near that. Try Google Cloud Run (I linked to it above). It’s barely extra sophisticated however you are able to do the same “ship it and never fear about servers” method. It scales right down to 0 and has a free tier which is sweet as properly.

It actually relies upon. You will get a server for like $5 a month. However you possibly can in all probability host low cost static websites without cost relying on the place you host them.

That seems like static content material to me. During which case Go might be not supreme. You could possibly in all probability use a static content material generator (try Hugo and Jekyll + GitHub Pages!).

I’ve a unique opinion. Go is IMHO properly suited to static websites. However Hugo could also be an choice.

Go is an effective selection for net growth typically, however I can’t say on your web site as I’ve by no means seen it. However this web site is constructed by Go and right here is how I hosted it. Principally a Go website online is constructed by Go html templates along with CSS and Javascript if wanted.

It’s nice, however it’s not precisely the primary device I’d attain for for this objective. Like – you could possibly additionally use Rust to construct an executable that serves static content material, however I wouldn’t SUGGEST it except you had a cause (perhaps you wished to study Rust, perhaps you already know Rust very well so it’s quick so that you can construct it utilizing Rust, and so forth.).

Only for instance, in your information you may have 9 steps to get it deployed (organising a reverse proxy, and so forth.). In the event you used one thing like GitHub Pages and a static web site generator, that might be simplified to one thing like “test in your code to your repo, it builds robotically and is robotically hosted”. I’m not making an attempt to discourage anyone and Go is a really great tool that I exploit each day in my profession, however I’m additionally not going to say that Go is the perfect device for ALL jobs.

That mentioned, @attain if you wish to study Go, this may be a nice venture. Perhaps tell us what you contemplate low cost hosting-wise and we are able to counsel hosts (I believe Digital Ocean has a $4/month droplet). You’ll be able to then begin asking extra particular questions alongside the way in which.

My supplier, which is coincidentally the identical because the one our choir web page runs on fees greater than 4$/month (I believe 8 EUR), in order that argument certainly mute. I believe, for these 8 EUR I additionally get SSH entry to the server, however I don’t know, if I can execute code on it.
So go it’s. Please don’t count on me to current the outcome right here anytime quickly – this can be a long run venture for positive :slight_smile:

No matter whether or not it’s the most easy answer to your proposed downside as Dean factors out, Go is a comparatively easy language that promotes easy code, and considered one of it’s main use circumstances is net stuff. Studying to program in Go by implementing net stuff seems like an excellent begin. A bonus to studying with Go is that it’s strongly and statically typed. It doubtless goes in opposition to the present developments, and perhaps it’s simply that I’m older, however I believe studying with sorts early is sweet. I’ve seen some younger devs that realized programming with dynamic languages have a tough time choosing up static typing later.

Simply to get you began on serving static content material (and you can begin including extra dynamic stuff later), try this instance for a file server:

About as straightforward because it will get. If you wish to begin mixing logic in with that, try this weblog put up I did some time in the past with a sort of hybrid method:

Or simply clone this repo and run it:

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments