Giter Club home page Giter Club logo

py-ser's Introduction

progress-banner

Py-Ser

Py-Ser is a lightweight and simple HTTP server implemented in Python. It provides functionalities for handling HTTP requests, including serving static files, echoing content, and capturing user-agent information.

Features

  • File Serving: Serve static files from a specified directory.
  • Echo Endpoint: Echo the content specified in the URL.
  • User-Agent Endpoint: Mine blocks with proof-of-work and validate transactions for added security.
  • State Tracking: Retrieve and display the User-Agent information from the HTTP headers.

Getting Started

Prerequisites

Python 3.x No additional dependencies

Installation

Clone the repository:

  1. Clone the repository:

     git clone https://github.com/your-username/Py-Ser.git
     cd Py-Ser
  2. Run the server:

  python main.py --directory /path/to/serve

Replace /path/to/serve with the directory you want to serve.

Usage

Once the server is running, you can access different endpoints:

Hello World:

  http://localhost:4221/

Echo Endpoints:

  http://localhost:4221/](http://localhost:4221/echo/your_content_here

User-Agent Endpoint:

  http://localhost:4221/user-agent

File Serving:

  http://localhost:4221/your_file_name

Contributing

Contributions are welcome! If you have ideas for improvements, new features, or bug fixes, please open an issue or submit a pull request.

py-ser's People

Contributors

notlelouch avatar codecrafters-bot 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.