Our User Interface

This lesson shows the implementation of the application by designing a server and making a front end to see how things work.

Designing a server

We haven’t yet coded the function with which our program must be started. This is (always) the function main() as in C, C++ or Java. In it, we will start our web server, e.g., we can start a local web server on port 8080 with the command:

http.ListenAndServe(":8080", nil)

The web server listens for incoming requests in an infinite loop, but we must also define how this server responds to these requests. We do this by making so-called HTTP handlers with the function HandleFunc. For ...

Get hands-on with 40+ tech skills courses.