Used to get all registered routes in Opine Application
Special-cased "all" method, applying the given route path
,
middleware, and callback to every HTTP method.
The app.mountpath property contains one or more path patterns on which a sub-app was mounted.
The app.routes object houses all of the routes defined mapped by the associated HTTP verb. This object may be used for introspection capabilities, for example Opine uses this internally not only for routing but to provide default OPTIONS behaviour unless app.options() is used. Your application or framework may also remove routes by simply by removing them from this object.
Stack of configured routes
Initialize application configuration.
Disable setting
.
Check if setting
is disabled.
app.disabled('foo') // => true
app.enable('foo') app.disabled('foo') // => false
Emit an event using the applications event emitter.
Events will be raised based on the passed event string and any listening on() methods will receive the passed arg as an argument.
Enable setting
.
Check if setting
is enabled (truthy).
app.enabled('foo') // => false
app.enable('foo') app.enabled('foo') // => true
Register the given template engine callback fn
for the
provided extension ext
.
Dispatch a req, res pair into the application. Starts pipeline processing.
If no callback is provided, then default error handlers will respond in the event of an error bubbling through the stack.
Initialize the server.
Lazily adds the base router if it has not yet been added.
We cannot add the base router in the defaultConfiguration because it reads app settings which might be set after that has run.
Listen for connections.
A Deno Server
is returned.
The mount event is fired on a sub-app, when it is mounted on a parent app. The parent app is passed to the callback function.
NOTE: Sub-apps will:
Return the app's absolute pathname based on the parent(s) that have mounted it.
For example if the application was mounted as "/admin", which itself was mounted as "/blog" then the return value would be "/blog/admin".
Render the given view name
name with options
and a callback accepting an error and the
rendered template string.
Example:
app.render('email', { name: 'Deno' }, function(err, html) { // ... })
Assign setting
to val
, or return setting
's value.
app.set('foo', 'bar'); app.get('foo'); // => "bar"
Mounted servers inherit their parent server's settings.
Generated using TypeDoc
Opine instance itself is a request handler, which could be invoked without third argument.