Skip to content

Commit 18c89b5

Browse files
committed
WIP Client bootstrapping.
1 parent d1a74f1 commit 18c89b5

25 files changed

+2119
-4450
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
.idea
33
.git
44
node_modules
5+
bower_components
56
dist
67
*.eslintcache
78
*.tsbuildinfo
89

910
test-data
1011
packages/node/test-data
1112

12-
1313
yarn.lock

example/TypeScript/index.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import * as exceptionless from "../../dist/exceptionless";
1+
import { Exceptionless } from "@exceptionless/browser";
22

3-
var client = exceptionless.ExceptionlessClient.default;
4-
client.config.serverUrl = "http://localhost:5000";
5-
client.config.useDebugLogger();
3+
Exceptionless.startup({
4+
serverUrl: "http://localhost:5000",
5+
});
6+
7+
Exceptionless.config.useDebugLogger();
68

79
// set some default data
8-
client.config.defaultData["SampleUser"] = {
10+
Exceptionless.config.defaultData["SampleUser"] = {
911
id:1,
1012
name: "Blake",
1113
password: "123456",
@@ -18,5 +20,5 @@ client.config.defaultData["SampleUser"] = {
1820
}
1921
};
2022

21-
client.config.defaultTags.push("Example", "JavaScript", "TypeScript");
22-
client.submitLog("Testing");
23+
Exceptionless.config.defaultTags.push("Example", "JavaScript", "TypeScript");
24+
Exceptionless.submitLog("Testing");

example/express/app.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import express from "express";
22
const app = express()
33

4-
import { ExceptionlessClient } from "@exceptionless/node";
5-
const client = ExceptionlessClient.default;
6-
client.config.apiKey = "LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw";
7-
client.config.serverUrl = "http://localhost:5000";
8-
client.config.useDebugLogger();
9-
client.config.useLocalStorage();
4+
import { Exceptionless } from "@exceptionless/node";
5+
6+
Exceptionless.startup({
7+
apiKey: "LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw",
8+
serverUrl: "http://localhost:5000"
9+
});
10+
11+
Exceptionless.config.useDebugLogger();
12+
Exceptionless.config.useLocalStorage();
1013

1114
// set some default data
12-
client.config.defaultData["SampleUser"] = {
15+
Exceptionless.config.defaultData["SampleUser"] = {
1316
id:1,
1417
name: "Blake",
1518
password: "123456",
@@ -22,15 +25,15 @@ client.config.defaultData["SampleUser"] = {
2225
}
2326
};
2427

25-
client.config.defaultTags.push("Example", "Node");
28+
Exceptionless.config.defaultTags.push("Example", "Node");
2629

2730
app.get("/", function index(req, res) {
28-
client.submitLog("loading index content");
31+
Exceptionless.submitLog("loading index content");
2932
res.send("Hello World!");
3033
});
3134

3235
app.get("/about", function about(req, res) {
33-
client.submitFeatureUsage("about");
36+
Exceptionless.submitFeatureUsage("about");
3437
res.send("About");
3538
});
3639

@@ -39,12 +42,12 @@ app.get("/boom", function boom(req, res) {
3942
});
4043

4144
app.use(function(err, req, res, next) {
42-
client.createUnhandledException(err, "express").addRequestInfo(req).submit();
45+
Exceptionless.createUnhandledException(err, "express").addRequestInfo(req).submit();
4346
res.status(500).send("Something broke!");
4447
});
4548

4649
app.use(function(req, res, next) {
47-
client.createNotFound(req.originalUrl).addRequestInfo(req).submit();
50+
Exceptionless.createNotFound(req.originalUrl).addRequestInfo(req).submit();
4851
res.status(404).send("Sorry cant find that!");
4952
});
5053

@@ -54,7 +57,7 @@ const server = app.listen(3000, function () {
5457

5558
var message = "Example app listening at http://" + host + port;
5659
console.log(message);
57-
client.submitLog("app", message, "Info");
60+
Exceptionless.submitLog("app", message, "Info");
5861
});
5962

6063
export default app;

0 commit comments

Comments
 (0)