cirospaciari / socketify.py

Bringing Http/Https and WebSockets High Performance servers for PyPy3 and Python3
https://www.socketify.dev
MIT License
1.45k stars 56 forks source link

App can't be hit with http call when executed via CLI #167

Closed danjoyboy closed 9 months ago

danjoyboy commented 9 months ago

Hi @cirospaciari I was unable to run socketify with CLI

I was using the exact same command as mentioned in the docs (by defining run function that retrieve app as arg)

the app shown its running but when I hit using curl/postman the request is hanging

any resolution for this?

thanks in advance!

cirospaciari commented 9 months ago

Can you show me a minimal reproduction? The command line and the app.py?

danjoyboy commented 9 months ago

main.py

from socketify import App

app = App()

def run(app: App):
    app.get("/", lambda res, req: res.end("Hello worldddddd!!!"))

cmd

python -m socketify main:run
danjoyboy commented 9 months ago

anyway nvm, I could hit the app by removing this line

app = App()

into this

from socketify import App

def run(app: App):
    app.get("/", lambda res, req: res.end("Hello worldddddd!!!"))

and now its working.. thanks! for the response!