This project contains a basic HTTP server application written in the Go programming language. The server can be used to handle incoming HTTP requests and serve specific static files.
These instructions will help you run and develop the project on your local machine. To run the project, you will need Go language installed and a text editor.
To run this project, you need the following software components:
- Go language must be installed. You can download and follow the installation instructions from the official website: https://golang.org/
To run this project on your local machine, follow these steps:
- Clone this repository or download the ZIP file and extract it to a folder.
git clone https://github.com/username/simple-http-server.git
- Navigate to the folder:
cd simple-http-server
- Start the server by running the following command:
go run main.go
- Open
http://localhost:8080in your browser or API testing tool.
This HTTP server handles specific requests and returns a simple response:
-
For any GET or POST request to the main URL ("/"), it responds with the message "Hello, this is a GET/POST request!"
-
For URL paths starting with "/static/", it serves static files. For example, you can request the "index.html" file by accessing
http://localhost:8080/static/index.html.
The project consists of the main file "main.go," which implements the specified functionality. Changes will take effect after restarting the server.
If you would like to contribute to this project, we welcome pull requests. Please open an issue to discuss any significant changes before making a pull request.
This project is licensed under the MIT License. See the LICENSE file for more information.
If you have any questions or feedback, please contact us at ahmetimalf2@gmail.com.