-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
26 lines (19 loc) · 664 Bytes
/
Copy pathindex.js
File metadata and controls
26 lines (19 loc) · 664 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const express = require('express');
var up9Monitor = require("up9-node")({
"up9Server": "up9.app",
"serviceName": "your-service-name",
"clientId": "your-client-id",
"clientSecret": "your-client-secret",
"hostnameOverrides": {"https://your-external-dns-address": "your-service-name"}
});
const app = express();
app.use(up9Monitor.express());
app.use(express.json()); // support json encoded bodies
const port = 3000;
app.get('/', (req, res) => {
res.status(200).send("hello world!");
});
app.post('/', (req, res) => {
res.status(200).send(req.body);
});
app.listen(port, () => console.log("server listening on port " + port));