However, the following methods are available for convenience, and are the ones you will use most often. Each method's name responds to an HTTP request method. For example, a route declared with app.get(...), will respond to HTTP GET requests.
Your requestHandler should take the following form:
Your requestHandler can return any Dart value, whether a function, or an object. See the Requests and Responses pages for detailed documentation.
Route paths do not have to begin with a forward slash, as leading and trailing slashes are stripped from route paths internally.
Say you're building an API, or an MVC application. You typically want to serve the same view template on multiple paths, corresponding to different ID's. You can do this as follows, and all parameters will be available via req.params:
Remember, route parameters must be preceded by a colon (':'). Parameter names must start with a letter or underscore, optionally followed by letters, underscores, or numbers. Parameters will match any character except a forward slash ('/') in a request URI.
With a special syntax, you can build routes that automatically parse parameters as ints or doubles: