pull/39/head
Ciro 2022-11-08 08:34:26 -03:00
rodzic 5486f74b18
commit 2e4479cf73
1 zmienionych plików z 18 dodań i 16 usunięć

Wyświetl plik

@ -28,17 +28,8 @@ This project aims to bring high performance PyPy3 web development and will bring
We created and adapt the full C API from [uNetworking/uWebSockets](https://github.com/uNetworking/uWebSockets) and integrate libuv powered fetch and file IO, this same C API is used by [Bun](https://bun.sh/) We created and adapt the full C API from [uNetworking/uWebSockets](https://github.com/uNetworking/uWebSockets) and integrate libuv powered fetch and file IO, this same C API is used by [Bun](https://bun.sh/)
Overly simple hello world app [click here](https://github.com/cirospaciari/socketify.py/tree/main/examples) for more examples ## Install
```python For macOS x64 & Silicon, Linux x64, Windows
from socketify import App
app = App()
app.get("/", lambda res, req: res.end("Hello World socketify from Python!"))
app.listen(3000, lambda config: print("Listening on port http://localhost:%d now\n" % config.port))
app.run()
```
pip install
```bash ```bash
pip install git+https://github.com/cirospaciari/socketify.py.git pip install git+https://github.com/cirospaciari/socketify.py.git
@ -48,19 +39,28 @@ pypy3 -m pip install git+https://github.com/cirospaciari/socketify.py.git
pypy3 -m pip install -e git+https://github.com/cirospaciari/socketify.py.git@main#egg=socketify pypy3 -m pip install -e git+https://github.com/cirospaciari/socketify.py.git@main#egg=socketify
``` ```
requirements.txt Using install via requirements.txt
```text ```text
git+https://github.com/cirospaciari/socketify.py.git@main#socketify git+https://github.com/cirospaciari/socketify.py.git@main#socketify
``` ```
install via requirements.txt
```bash ```bash
pip install -r ./requirements.txt pip install -r ./requirements.txt
#or specify PyPy3 #or specify PyPy3
pypy3 -m pip install -r ./requirements.txt pypy3 -m pip install -r ./requirements.txt
``` ```
## Examples
Hello world app
```python
from socketify import App
app = App()
app.get("/", lambda res, req: res.end("Hello World socketify from Python!"))
app.listen(3000, lambda config: print("Listening on port http://localhost:%d now\n" % config.port))
app.run()
```
SSL version sample SSL version sample
``` python ``` python
from socketify import App, AppOptions from socketify import App, AppOptions
@ -71,7 +71,9 @@ app.listen(3000, lambda config: print("Listening on port http://localhost:%d now
app.run() app.run()
``` ```
Build local from source We have more than 20 examples [click here](https://github.com/cirospaciari/socketify.py/tree/main/examples) for more
## Build local from source
```bash ```bash
#clone and update submodules #clone and update submodules
git clone https://github.com/cirospaciari/socketify.py.git git clone https://github.com/cirospaciari/socketify.py.git