Skip to content

This is a basic Golang web server that serves static files. This is a minimal web server, handle simple HTTP requests, & manage shared variables safely using mutexes to prevent race conditions.

nevinmathew/Simple-Web-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Simple-Web-Server

Overview

This is a simple Golang web server application that serves static files and provides a few basic HTTP endpoints. It demonstrates the use of the Go programming language for building web applications.

Table of Contents

Features

  • Static File Server: The web server serves static files from the ./static directory, which can be useful for hosting HTML, CSS, JavaScript, and other assets for a website.

  • "Hi" Endpoint: Accessing the /hi endpoint responds with a simple "Hi" message, showcasing how to handle HTTP requests and provide responses.

  • Increment Counter Endpoint: Accessing the /increment endpoint increments a counter and returns the updated counter value. This demonstrates the use of mutexes to safely manipulate shared variables in a multi-threaded environment. The use of a mutex highlights the importance of guarding against race conditions in web server applications.

Usage

About

This is a basic Golang web server that serves static files. This is a minimal web server, handle simple HTTP requests, & manage shared variables safely using mutexes to prevent race conditions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published