Expose class

Exposes a Controller or a Controller method to the Internet. Example:

@Expose('/elements')
class ElementController extends Controller {

  @Expose('/')
  List<Element> getList() => someComputationHere();

  @Expose('/int:elementId')
  getElement(int elementId) => someOtherComputation();

}

Constructors

Expose(String path, {String method: "GET", Iterable<RequestHandler> middleware: const [], String as, List<String> allowNull: const []})
const
Expose.method(String method, {Iterable<RequestHandler> middleware, String as, List<String> allowNull: const []})
const

Properties

allowNull List<String>
final
as String
final
hashCode int
The hash code for this object. [...]
read-only, inherited
method String
final
middleware Iterable<RequestHandler>
final
path String
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Constants

delete → const Expose
const Expose(null, method: 'DELETE')
get → const Expose
const Expose(null, method: 'GET')
const Expose(null, method: 'HEAD')
patch → const Expose
const Expose(null, method: 'PATCH')
post → const Expose
const Expose(null, method: 'POST')
put → const Expose
const Expose(null, method: 'PUT')