Project

General

Profile

Actions

Feature #5656

closed

Static WResource routing with arguments in path (for RESTful API)

Added by Roel Standaert about 7 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/14/2017
Due date:
% Done:

0%

Estimated time:

Description

At the moment, static resources can be added to a WServer with WServer::addResource and an exact path. It would be useful to be able to add a path with arguments (e.g. "/user/{id}"), which matches any path starting with /user/ and make the values of these arguments accessible somehow.

Actions #1

Updated by Roel Standaert about 7 years ago

To further improve this, we could also make it possible to add resources defined by a function pointer or lambda function, so that it's not always necessary to subclass WResource.

We can maybe even automatically provide the arguments in the path as parameters, so you can write lambdas like [](const Http::Request &request, Http::Response &response, int id){ ... }.

Actions #2

Updated by Roel Standaert about 4 years ago

  • Status changed from New to Closed

This feature was added in Wt 4.0.4

Actions

Also available in: Atom PDF