This is a simple and ligtweight website server with Golang. Golang is a very robust and fast programming language. We will build this with only Golang no extra dependencies. On linux the build size is 6.0M.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Golang runtime is needed to be installed to get this project running.
Install Golang by visiting Go.dev to install Golang on your machine. The installation binaries are available for any Operating System (Windows, Mac, Linux, etc.).
Just clone the project
git clone https://github.com/devvspaces/golang_web_server
The default root directory for static files is the website
directory. You can add more files there as you want.
To run the server
cd golang_web_server
go run main.go
Visit your localhost http://localhost:8000 to view the website. By defualt this uses your index.html file in the root folder as the index.
- Golang - Programming Language
- @devvspaces - Idea & Initial work
See also the list of contributors who participated in this project.
- Hat tip to anyone whose code was used
- Inspiration
- References
- Golang Documentation