Giter Club home page Giter Club logo

love-card's Introduction

Fun HTTP Server Project

Prerequisites

This is a fun project designed to explore HTTP server middleware and logging in Go. The goal is to learn and have fun while building a simple HTTP server with gRPC gateway and Next.js as the frontend.

Introduction

Welcome to the Fun HTTP Server Project! This project demonstrates how to create an HTTP server in Go with middleware for logging request details. The server logs information such as request method, URL, status code, duration, client IP, user agent, and more.

Getting Started

Prerequisites

  • Go 1.15 or later
  • A basic understanding of Go programming
  • Interest in learning about gRPC

Installation

  1. Clone the repository:

    git clone https://github.com/peacewalker122/love-card.git
  2. Change into the project directory:

    cd fun-http-server
  3. Install the required dependencies:

    go get -u github.com/rs/zerolog

Running the Server

  1. Run the HTTP server:

    go run main.go
  2. Open your web browser or use a tool like curl to make requests to the server:

    curl http://localhost:8080/

Project Structure

  • main.go: The main application file that sets up the HTTP server and logging middleware.
  • statusResponseWriter.go: A helper file that wraps the http.ResponseWriter to capture the status code.

TODO List

  • Create a basic HTTP server with logging middleware
  • Implement detailed logging using zerolog
  • Add more routes and handlers to the server
  • Create a frontend for interacting with the server
    • Design a simple HTML page to display server responses
    • Implement JavaScript to make requests to the server
    • Style the frontend using CSS for better user experience
  • Add more middleware functions (e.g., authentication, rate limiting)
  • Write tests for the server and middleware

Contributing

This project is for fun and learning, but contributions are welcome! Feel free to fork the repository, make improvements, and submit pull requests.

License

This project is licensed under the MIT License.

Acknowledgments

  • Thanks to the authors of zerolog for providing a powerful logging library.
  • Thanks to the Go community for their excellent documentation and resources.

Enjoy building and have fun!

love-card's People

Contributors

peacewalker122 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.