easyhttp is a simple HTTP server made for study purposes.
Use the package manager pip to install easyhttp.
Simply run:
pip install easyhttp
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')