Skip to content

Commit a560aa9

Browse files
authored
Update README.md
1 parent 9917313 commit a560aa9

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This library is created to be fully independent, not requiring integration with
2424
pip install winged-python==0.1.0
2525
```
2626

27-
## Usage Example
27+
## Simple Usage Example
2828

2929

3030
```python
@@ -90,6 +90,26 @@ print(divC.generate())
9090
</div>
9191
```
9292

93+
## Usage with FastAPI Render
94+
95+
```python
96+
from fastapi import FastAPI
97+
from fastapi.responses import HTMLResponse
98+
99+
from winged.HTML.div import Div
100+
from winged.HTML.h import H
101+
from winged.HTML.string import String
102+
103+
104+
@app.get('/', response_class=HTMLResponse)
105+
async def home():
106+
divC = Div(("class", "container"))
107+
h = H("1")
108+
h.add(String("Hello World"))
109+
divC.add(h)
110+
return divC.get_string() # Return HTML String
111+
```
112+
93113
## Contributing
94114

95115
To contribute, it's simple, follow the guidelines below to prepare your development environment

0 commit comments

Comments
 (0)