1 | /*
|
2 | Kettle App support
|
3 |
|
4 | Copyright 2012-2013 OCAD University
|
5 |
|
6 | Licensed under the New BSD license. You may not use this file except in
|
7 | compliance with this License.
|
8 |
|
9 | You may obtain a copy of the License at
|
10 | https://github.com/fluid-project/kettle/blob/master/LICENSE.txt
|
11 | */
|
12 |
|
13 | ;
|
14 |
|
15 | var fluid = require("infusion");
|
16 |
|
17 | /** A Kettle "app" is an "independently mountable application unit". An app aggregates together
|
18 | * a set of "handlers" which are mounted within it to handle one or more request types
|
19 | * at certain URL paths. Kettle includes support for handlers of HTTP endpoints and
|
20 | * experimental support for WebSockets endpoints. One or more Kettle apps may be
|
21 | * aggregated together into a Kettle "servers" of type <code>kettle.server</code>. A Kettle
|
22 | * server corresponds directly to a node.js HTTP server (connect/express server) in terms
|
23 | * of being "a thing listening on a TCP port". Configuration supplied to the
|
24 | * options of all apps at their options path "handlers" is aggregated together to their enclosing
|
25 | * server.
|
26 | */
|
27 |
|
28 | fluid.defaults("kettle.app", {
|
29 | gradeNames: ["fluid.component"],
|
30 | requestHandlers: {},
|
31 | listeners: {
|
32 | "onCreate.register": {
|
33 | listener: "kettle.server.registerApp",
|
34 | args: ["{kettle.server}", "{that}"]
|
35 | }
|
36 | },
|
37 | components: {
|
38 | requests: {
|
39 | type: "kettle.requests"
|
40 | }
|
41 | }
|
42 | });
|