basePath function

String? basePath(
  1. Context c
)

Returns the resolved base path for the current request.

Unlike baseRoutePath, dynamic segments in the group prefix are replaced with their actual values from the request URL.

final sub = app.group('/:tenant');
sub.get('/data', (c) {
  print(basePath(c)); // e.g. '/acme' for a request to '/acme/data'
  return c.text('ok');
});

Implementation

String? basePath(Context c) => c.basePath;