@trenskow/app 0.7.0 → 0.7.1
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/.vscode/launch.json +1 -1
- package/README.md +18 -13
- package/package.json +1 -1
package/.vscode/launch.json
CHANGED
package/README.md
CHANGED
|
@@ -123,21 +123,26 @@ import { Application, Endpoint } from '@trenskow/app';
|
|
|
123
123
|
|
|
124
124
|
const app = new Application({ port: 8080 });
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
.renderer(async ({ result, response }) => {
|
|
126
|
+
try {
|
|
127
|
+
|
|
128
|
+
const root = new Endpoint()
|
|
129
|
+
.mount('iam', await import('./iam.js'));
|
|
130
|
+
|
|
131
|
+
const renderer = async ({ result, response }) => {
|
|
133
132
|
response.headers.contentType = 'text/plain';
|
|
134
133
|
response.end(result);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
await app
|
|
137
|
+
.root(root)
|
|
138
|
+
.renderer(renderer)
|
|
139
|
+
.start();
|
|
140
|
+
|
|
141
|
+
console.info(`Application is running on port ${app.port}`)
|
|
142
|
+
|
|
143
|
+
} catch (error) {
|
|
144
|
+
console.error(error);
|
|
145
|
+
}
|
|
141
146
|
````
|
|
142
147
|
|
|
143
148
|
````javascript
|