Skip to content

How to Create a Go (Golang) based web server from scratch

Notifications You must be signed in to change notification settings

digitallyamar/Go-WebServer-Tutorial

Repository files navigation

Go-WebServer-Tutorial

How to Create a Go (Golang) based web server from scratch

How to run:

Chapter 01 - Basic Web Server

go run main.go  

Go to your favorite browser and enter the url: http://localhost:9000

Chapter 02 - REST GET Web Server

cd server  
go run main.go  

Go to your favorite browser and enter the url: http://localhost:9000/capital/India

Chapter 03 - HTTP ErrorCodes WebServer

cd server  
go run main.go  

Go to your favorite browser and enter the url: http://localhost:9000/capital/India
Go to your favorite browser and enter the url: http://localhost:9000/capital/USA
Go to your favorite browser and enter the url: http://localhost:9000/capitals/India

Chapter 04 - Basic Routes Web Server

cd server  
go run main.go  

Go to your favorite browser and enter the url: http://localhost:9000/capital/India
Go to your favorite browser and enter the url: http://localhost:9000/capital/USA
Go to your favorite browser and enter the url: http://localhost:9000/capitals/India
Go to your favorite browser and enter the url: http://localhost:9000/servertime

Chapter 05 - MultiRoute ServeMux WebServer

cd server  
go run main.go  

Go to your favorite browser and enter the url: http://localhost:9000/capital/India
Go to your favorite browser and enter the url: http://localhost:9000/capital/USA
Go to your favorite browser and enter the url: http://localhost:9000/capitals/India
Go to your favorite browser and enter the url: http://localhost:9000/servertime
Go to your favorite browser and enter the url: http://localhost:9000/random

Chapter 06 - MultiRoute GorillaMux WebServer

cd server  
go run main.go  

Go to your favorite browser and enter the url: http://localhost:9000/capital/India
Go to your favorite browser and enter the url: http://localhost:9000/capital/USA
Go to your favorite browser and enter the url: http://localhost:9000/capitals/India
Go to your favorite browser and enter the url: http://localhost:9000/servertime
Go to your favorite browser and enter the url: http://localhost:9000/random
Go to your favorite browser and enter the url: http://localhost:9000/users/students/120

Releases

No releases published

Packages

No packages published

Languages