Micro HTTP library for Python.
Project description
🍵 Tea
Micro HTTP library for Python.
Tea is more similar to Express.js-like syntax (which is web framework for JavaScript) than Flask-like syntax. Fun fact: Developer thinks it is better.
Quick Start
$ pip install tea-web
Hello, World!
Simple Hello, World!
example in Tea and equivalents in Flask and Express.js. See /examples
for more example.
Tea
# app.py
from tea import Tea
app = Tea()
def handle_index(req, res):
res.send("Hello, World!")
app.get("/", handle_index)
app.listen(port=8080)
Flask
# app.py
from flask import Flask
app = Flask(__name__)
@app.route("/", methods=["GET"])
def handle_index():
return "Hello, World!"
app.run(port=8080)
Express.js
// app.js
import express from "express";
const app = express();
app.get("/", (req, res) => {
res.send("Hello, World!");
});
app.listen(8080);
Documentation
- See DOCUMENTATION.md.
License
- Licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tea-web-0.1.2.tar.gz
(6.4 kB
view hashes)