A lightweight Express.js-inspired web framework for Python
from expressify import expressify
# Create a new app
app = expressify()
@app.get('/')
def home(req, res):
res.send('Hello, World!')
# Start the server
if __name__ == '__main__':
app.listen(port=3000, hostname='127.0.0.1') # Default port and hostname
Everything you need to build modern web applications and APIs in Python, with an intuitive Express.js-like API.
Define routes using decorators with support for path parameters, query strings, and multiple HTTP methods.
Apply middleware globally, to specific routes, or grouped routes. Chain multiple middleware functions effortlessly.
Seamless integration with Jinja2 templates for dynamic content rendering with context data.
Easily serve static files like CSS, JavaScript, and images with built-in middleware.
Comprehensive error handling with custom error pages and middleware for catching exceptions.
Built-in support for managing user sessions, cookies, and stateful interactions.
Built-in development server with hot reloading for efficient and streamlined development workflow.
Create web apps in minutes with Expressify's intuitive API.
Expressify's intuitive API makes it easy to create web applications and APIs with minimal code. Similar to Express.js, but with Python's elegance.
Clean and intuitive route definitions using Python decorators
Expressify handles request and response handling with ease
Expressify supports all types of routes and query parameters
Expressify automatically sets the content-type header for JSON responses
Boost productivity with automatic server restarts on code changes
from expressify import expressify
# Create a new app
app = expressify()
@app.get('/')
def home(req, res):
res.send('Hello, World!')
@app.get('/api/users')
def get_users(req, res):
# Query parameter: /api/users?limit=10
limit = int(req.query.get('limit', 10))
users = [{'id': i, 'name': f'User {i}'} for i in range(limit)]
res.json(users)
@app.get('/users/:id')
def get_user(req, res):
# Path parameter: /users/42
user_id = req.params.get('id')
# Find user (simulated)
user = {'id': user_id, 'name': f'User {user_id}'}
res.json(user)
@app.post('/api/users')
def create_user(req, res):
# Access JSON body data
new_user = req.body
# Create user (simulated)
new_user['id'] = 42
res.status(201).json(new_user)
# Start the server
if __name__ == '__main__':
app.listen(port=3000, hostname='127.0.0.1') # Default port and hostname
Start building your web applications with Expressify today.
Everything you need to know to get up and running with Expressify.
Learn moreBrowse example applications and code snippets to learn by example.
View examplesDetailed documentation of all Expressify classes, methods and properties.
Explore APILearn about the project, its philosophy, and the people behind it.
Read more