2020-06-18
1931
#go
Michiel Mulders
20306
Jun 18, 2020 â‹… 6 min read

Creating a web server with Golang

Michiel Mulders Michiel loves the Node.js and Go programming languages. A backend/core blockchain developer and avid writer, he's very passionate about blockchain technology.

Recent posts:

Rxjs Adoption Guide: Overview, Examples, And Alternatives

RxJS adoption guide: Overview, examples, and alternatives

Get to know RxJS features, benefits, and more to help you understand what it is, how it works, and why you should use it.

Emmanuel Odioko
Jul 26, 2024 â‹… 13 min read
Decoupling Monoliths Into Microservices With Feature Flags

Decoupling monoliths into microservices with feature flags

Explore how to effectively break down a monolithic application into microservices using feature flags and Flagsmith.

Kayode Adeniyi
Jul 25, 2024 â‹… 10 min read
Lots of multi-colored blue and purplish rectangles.

Animating dialog and popover elements with CSS @starting-style

Native dialog and popover elements have their own well-defined roles in modern-day frontend web development. Dialog elements are known to […]

Rahul Chhodde
Jul 24, 2024 â‹… 10 min read
Using Llama Index To Add Personal Data To Large Language Models

Using LlamaIndex to add personal data to LLMs

LlamaIndex provides tools for ingesting, processing, and implementing complex query workflows that combine data access with LLM prompting.

Ukeje Goodness
Jul 23, 2024 â‹… 5 min read
View all posts

8 Replies to "Creating a web server with Golang"

  1. Hi Will, at the section “Accept a form submission POST request”, you can find an example with a form request.

    Here’s a more concrete example:

    “`
    package main

    import (
    “log”
    “net/http”
    “io/ioutil”
    )

    func postRoute(rw http.ResponseWriter, req *http.Request) {
    body, err := ioutil.ReadAll(req.Body)
    if err != nil {
    panic(err)
    }

    // further handle request
    }

    func main() {
    http.HandleFunc(“/postRoute”, postRoute)
    log.Fatal(http.ListenAndServe(“:8080”, nil))
    }
    “`

    You can find the Gist here: https://gist.github.com/michielmulders/8c32a6978ec7829865608cd631e83c39

    Hope that helps! đź‘Ť

  2. Hello Michiel,

    Thanks for the tutorial. I should say awesome tutorial. It’s the first one that actually works ans is so well explained.

  3. I needed something this simple to get my project started. Thank you so much. Would love to see more small simple examples that takes this further.

  4. Michiel – hard to describe how useful this was! Tutorials on the web just used either handle or handlefunc, leaving it unclear which does what and when to choose one over the other. Reading your article made it very clear.

Leave a Reply