DEV Community

VICTOR OMONDI
VICTOR OMONDI

Posted on

URL Parameters in Flask vs Express

Flask

@app.route('/api/v1/users/<user_id>')
def handler(user_id):
    # route handler
   # use user_id
Enter fullscreen mode Exit fullscreen mode

Express

app.get('/api/v1/users/:userId', (req, res) => {
    // route handler
   const userId = req.params.userId;
});
Enter fullscreen mode Exit fullscreen mode

Top comments (0)