This project implements a simple web server using Go.
To setup a webserver on your system, follow these simple steps:
-
Clone the repository:
https://github.com/veera-damisetti/go-web-server.git cd go-web-server -
Build the Project
go build main.go
-
Create a Service Unit File
sudo vi /etc/systemd/system/v-server.service [Unit] Description=Go Server by Veera After=network.target [Service] ExecStart=/bin/bash -c '<path to binary>' WorkingDirectory= <path to binary workdir> Restart=always User=root Group=root [Install] WantedBy=multi-user.target
-
Reload systemd
sudo systemctl daemon-reload
-
Enable and Start the Service
sudo systemctl enable v-server sudo systemctl start v-server
-- Note:
- By defualt webserver will listen on port 8443, you can change the port in main.go file