Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 930 Bytes

File metadata and controls

42 lines (30 loc) · 930 Bytes

Slash is a Python framework for web applications.

📦 Installation

Slash can be installed directly using pip.

pip install "slash @ git+https://github.com/jessetvogel/slash.git@main"

Alternatively, slash can be installed by adding the following dependency to your pyproject.toml file.

[project]
dependencies = [
  "slash @ git+https://github.com/jessetvogel/slash.git@main"
]

📘 Example

The following script will create a page with the text 'Hello world'. Run the script and go to http://localhost:8080 to see the result.

from slash import App
from slash.html import Span

def home():
    return Span("Hello world").style({"color": "red"})

if __name__ == "__main__":
    app = App()
    app.add_endpoint("/", home)
    app.run()

For more elaborate examples, take a look at the examples folder.