-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathserver.js
More file actions
30 lines (25 loc) · 776 Bytes
/
server.js
File metadata and controls
30 lines (25 loc) · 776 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
27
28
29
30
const express = require('express');
const port = process.env.PORT || 8080;
const app = express();
app.use((request, _, next) => {
const requestTime = new Date(Date.now()).toString();
console.log(request.method, request.hostname, request.path, requestTime);
next();
});
app.get('/', (request, response) => {
response.send(`<!DOCTYPE html>
<html>
<head>
<title>Powered By Paketo Buildpacks</title>
</head>
<body>
<img style="display: block; margin-left: auto; margin-right: auto; width: 50%;" src="https://paketo.io/images/paketo-logo-full-color.png"></img>
</body>
</html>`);
});
app.get("/actuator/health", (request, response) => {
response.json({ status: "UP" });
});
app.listen(port, () => {
console.log(`App listening on port ${port}`);
});