Skip to content

Dityaren/Go-HTTP-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:
git clone https://github.com/Dityaren/Go-HTTP-Server
  1. Change into the project directory:
cd Go-HTTP-Server
  1. Build the project:
go build
  1. Run the server:
./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.

About

Go HTTP server that handles different routes and requests.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published