https://github.com/dityaren/go-http-server
Go HTTP server that handles different routes and requests.
https://github.com/dityaren/go-http-server
go golang golang-application http-server server
Last synced: 8 days ago
JSON representation
Go HTTP server that handles different routes and requests.
- Host: GitHub
- URL: https://github.com/dityaren/go-http-server
- Owner: Dityaren
- License: mit
- Created: 2023-06-23T09:22:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-14T08:06:35.000Z (over 2 years ago)
- Last Synced: 2026-01-14T15:19:17.226Z (5 months ago)
- Topics: go, golang, golang-application, http-server, server
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Go HTTP Server
This is a Go HTTP server that handles different routes and requests.
## Installation
To run the server, make sure you have Go installed. Then, follow these steps:
1. Clone the repository:
```bash
git clone https://github.com/Dityaren/Go-HTTP-Server
```
2. Change into the project directory:
```bash
cd Go-HTTP-Server
```
3. Build the project:
```bash
go build
```
4. Run the server:
```bash
./your-repository
```
The server will start running on `http://localhost:8080`.
## Routes
- `/` - Serves static files from the `static` directory.
- `/form` - Handles POST requests and displays form data.
- `/hello` - Responds with "Hello" for GET requests.
## Usage
### Static Files
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`
### Form Submission
To submit a form, send a POST request to `http://localhost:8080/form` with the following parameters:
- `name`: Your name
- `address`: Your address
The server will respond with the submitted form data.
### Hello Endpoint
To receive a "Hello" response, send a GET request to `http://localhost:8080/hello`.
## Contributing
If you find any issues or have suggestions for improvement, feel free to open an issue or submit a pull request.
## License
This project is licensed under the [MIT License](LICENSE).