Metadata-Version: 2.4
Name: localhost-server
Version: 0.1.0
Summary: Static file hosting library for local development
Author-email: Your Name <you@example.com>
License: MIT
Project-URL: Homepage, https://github.com/username/localhost
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# localhost

Static file hosting library for local development.

## Installation

```bash
pip install localhost
```

## Quick Start

```python
from localhost import serve

serve("./website/", port=4488)
```

## Options

```python
from localhost import serve, Options

server = serve(
    "./website/",
    port=4488,
    options=Options(
        index_file="demo.html",
        enable_js=False,
        auto_reload=True,
        log_level="info",
    )
)
```

## API

- `serve(folder, port, options)` - Start hosting
- `stop()` - Stop the server
- `Options` - Configuration dataclass

## Error Handling

```python
from localhost import serve, ErrFolderNotFound, ErrIndexNotFound, ErrPortInUse

try:
    server = serve("./website/", port=4488)
except ErrFolderNotFound:
    print("Folder does not exist")
except ErrIndexNotFound:
    print("No index file found")
except ErrPortInUse:
    print("Port is already in use")
```
