![]() |
VOOZH | about |
Golang is a procedural programming language ideal to build simple, reliable, and efficient software.
Create a project folder with a .go file inside eg. server.go.
Directory structure:
👁 ImageThe server.go file:
Run the server using the following command (make sure you're in the project directory):
go run server.goNote: You have to stop the server with Ctrl + C and restart via the same command whenever the server.go file is changed.
Console:
👁 ImageOpen the desired web browser and any of these URLs to verify if the server is running:
http://localhost:5000/ or http://localhost:5000/hiOutput:
👁 ImageCreate a static folder with all the static files.
Example directory structure:
Now Edit the server.go file:
Verifying if static files are served:
👁 Image