Simple HTTP Server with socket programming with Python 3.
- Python 3
python3 index.py
from app import (start, App)
app = App()
@app.route('/') # action for route /
def route_index(): # function name should have prefix 'route_'
# simple return 'Hello, World!' in browser
return app.response.send('Hello, World!')
start(app, __name__) # default run in port 8080
# or define your port
# start(app, __name__, port = 5000)
- Give star
!Important
- Fork
- Create pull request to this repository