/easyhttp

👩‍💻 Simple Python HTTP server

Primary LanguagePythonMIT LicenseMIT

✨ easyhttp ✨

GitHub last commit GitHub top language License

easyhttp is a simple HTTP server made for study purposes.

🚀 Installation

Use the package manager pip to install easyhttp.

Simply run:

pip install easyhttp

💻 Quickstart

import easyhttp

app = easyhttp.App()

def index(req, res):
    res.send('<h1>It\'s working!</h1>')

app.get('/', index)

app.listen(3000)

You can also use other HTTP methods:

app.get('/', index_get)
app.post('/', index_post)
app.put('/', index_put)
app.delete('/', index_delete)

Specifying a public folder can be done as shown below:

app.public('public')

📜 License

MIT