Skip to content

nixbytes/Simple-Web-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simple-Web-Server

This server is a basic web application written in Go, designed to handle form submissions and serve static content.

Key Functionalities

  • Static File Serving (/): Serves static assets (like index.html and form.html) from the ./static directory.
  • Form Handling (/form):
    • Handles POST requests containing form data (specifically name and address).
    • Parses the submitted form data and echoes the received "Name" and "Address" back to the client.
  • Hello Endpoint (/hello):
    • Responds to GET requests made to /hello with the text "hello".
    • Enforces strict routing: it only works for GET requests to the exact path /hello.

How to Run

  1. Run the application using go run main.go.
  2. Access the static page at http://localhost:8080/.
  3. Test the form submission at http://localhost:8080/form (requires a form.html file with action="/form").

About

Simple Web Server from FreeCodeCamp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors