Skip to content

Latest commit

 

History

History
59 lines (52 loc) · 2.17 KB

README.md

File metadata and controls

59 lines (52 loc) · 2.17 KB

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