Metadata-Version: 2.4
Name: aserver
Version: 0.2.1
Summary: a custom web server module.
Author-email: aadisankar1 <aadisankar1001@gmail.com>
License: MIT
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# AServer

A lightweight, Python web framework built using Python.  
Designed for simplicity, learning, and fast prototyping.

---

## Features

- 🚀 Zero dependencies (pure Python)
- 🛣️ Simple dictionary-based routing
- 🎯 Flask-style decorator support
- 📄 HTML template rendering with jinja-like syntax
- ⚡ Fast lightweight HTTP server
- 🔧 Easy to extend into a full framework

---

## Installation

```bash
pip install aserver
```

---

## Usage Example

### Basic Server Setup

```python
from aserver import ServerHTTP

data = {
    "name": "Aadi",
    "title": "AServer"
}

server = ServerHTTP(
    ("127.0.0.1", 1111),
    "index.html",
    data=data
)

@server.serve()
def routes():
    return {
        "/": "index.html",
        "/about": "about.html"
    }

```

---

### HTML Template Example

```html
<!DOCTYPE html>
<html>
<head>
    <title>{{ title }}</title>
</head>
<body>
    <h1>Welcome {{ name }}</h1>
</body>
</html>
```

---

### Routing Example

```python
{
    "/<id>": "index.html",
    "/about": "about.html",
    "/contact": "contact.html"
}
```

---

## How It Works

- Server listens on host and port
- Matches request path with route dictionary
- Loads corresponding HTML file
- Replaces {{ variables }} using provided data and uses {{ params }} for the variables inside urls along with {% for %} and {% if %} as well as their opposites

---

## Contact

email: aadisankar1001@gmail.com

## License

MIT License © 2026


