Skip to content

Commit 1f04a40

Browse files
Fix and upate example app (#106)
1 parent 0ba3288 commit 1f04a40

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

app.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@ var app = express();
88

99
var moesif = require('./lib');
1010

11-
var TEST_APPLICATION_ID = 'Your Moesif Application ID';
11+
const APPLICATION_ID = 'YOUR_MOESIF_APPLICATION_ID';
1212

13-
var moesifMiddleWare = moesif({applicationId: TEST_API_SECRET_KEY});
13+
var moesifMiddleWare = moesif({ applicationId: APPLICATION_ID });
1414

1515
app.use(moesifMiddleWare);
16+
app.use(express.json());
1617

1718
app.get('/', function (req, res) {
18-
res.json({a: 'abc'});
19+
res.json({ a: 'abc' });
1920
});
2021

2122
app.get('/abc', function (req, res) {
22-
res.json({abc: 'abcefg'});
23+
res.json({ abc: 'abcefg' });
2324
});
2425

25-
app.listen(3000, function () {
26-
console.log('Example app listening on port 3000!');
26+
const server = app.listen(0, () => {
27+
console.log(`Example app listening on port ${server.address().port}`);
2728
});

0 commit comments

Comments
 (0)