Giter Club home page Giter Club logo

webrouter's Introduction

WebRouter

WebRouter is a simple web server written in Go. It serves static files from the static directory and handles two routes: /hello and /form.

Getting Started

To run the server, you need to have Go installed on your machine. If you don't have it installed, you can download it from the official Go website. Once you have Go installed, you can clone this repository and navigate to the project directory:

git clone https://github.com/Abishnoi69/WebRouter.git
cd WebRouter

Then, you can run the server using the following command:

go run main.go

The server will start running on port 8080. You can access it by navigating to http://localhost:8080 in your web browser.

Routes

The server has two routes:

  • /hello: This route returns a simple "Hello, World!" message.

    • Handled by the HelloHandler function in the modules package.
  • /form: This route returns an HTML form that allows users to submit their name. When the form is submitted, the server responds with a message that includes the user's name.

    • Handled by the FormHandler function in the modules package.

Static Files

The static files served by the server are located in the static directory. The home page (index.html) contains a welcome message and a link to a contact form.

Dependencies

The server uses the following Go packages:

  • net/http: Provides HTTP client and server implementations.
  • html/template: Provides data-driven templates for generating HTML output.
  • log: Provides a simple logging package.
  • Many More .....

Contributing

If you find a bug or have an idea for a new feature, feel free to open an issue or submit a pull request. We welcome contributions from the community and are happy to help you get started.

webrouter's People

Contributors

ashokshau avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.