@trenskow/app 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -125,23 +125,23 @@ const app = new Application({ port: 8080 });
|
|
|
125
125
|
|
|
126
126
|
try {
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
const root = new Endpoint()
|
|
129
|
+
.mount('iam', await import('./iam.js'));
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
const renderer = async ({ result, response }) => {
|
|
132
132
|
response.headers.contentType = 'text/plain';
|
|
133
133
|
response.end(result);
|
|
134
|
-
|
|
134
|
+
};
|
|
135
135
|
|
|
136
136
|
await app
|
|
137
137
|
.root(root)
|
|
138
138
|
.renderer(renderer)
|
|
139
139
|
.start();
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
console.info(`Application is running on port ${app.port}`)
|
|
142
142
|
|
|
143
143
|
} catch (error) {
|
|
144
|
-
|
|
144
|
+
console.error(error);
|
|
145
145
|
}
|
|
146
146
|
````
|
|
147
147
|
|
|
@@ -515,8 +515,8 @@ Below is an example on how to use the method.
|
|
|
515
515
|
default export ({ endpoint }) => {
|
|
516
516
|
endpoint
|
|
517
517
|
.get(
|
|
518
|
-
|
|
519
|
-
|
|
518
|
+
async (context) => 'Hello, world!',
|
|
519
|
+
() => console.info("Said hello."));
|
|
520
520
|
};
|
|
521
521
|
````
|
|
522
522
|
|