get method

ChaseBuilder get([
  1. Object path = '/'
])
inherited

Creates a GET route builder for the given path(s).

GET requests are used to retrieve resources.

You can pass either a single path or a list of paths. When passing a list, the same handler is registered for all paths.

Example

app.get('/users').handle((ctx) async {
  await ctx.res.json({'users': []});
});

// Multiple paths with same handler
app.get(['/hello', '/ja/hello']).handle((ctx) async {
  await ctx.res.text('Hello');
});

Implementation

ChaseBuilder get([Object path = '/']) =>
    ChaseBuilder._(this, 'GET', _normalizePaths(_prefix, path));