This is a Go HTTP server that handles different routes and requests.
To run the server, make sure you have Go installed. Then, follow these steps:
- Clone the repository:
git clone https://github.com/Dityaren/Go-HTTP-Server
- Change into the project directory:
cd Go-HTTP-Server
- Build the project:
go build
- Run the server:
./your-repository
The server will start running on http://localhost:8080
.
/
- Serves static files from thestatic
directory./form
- Handles POST requests and displays form data./hello
- Responds with "Hello" for GET requests.
Any static files placed in the static
directory will be served by the server. Access them using the base URL.
Example: http://localhost:8080/index.html
To submit a form, send a POST request to http://localhost:8080/form
with the following parameters:
name
: Your nameaddress
: Your address
The server will respond with the submitted form data.
To receive a "Hello" response, send a GET request to http://localhost:8080/hello
.
If you find any issues or have suggestions for improvement, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.