Skip to content

Commit 3978e4b

Browse files
committed
chore(): add server version info and fix docker node version
1 parent 49ba951 commit 3978e4b

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:lts-alpine
1+
FROM node:22.19.0-alpine
22
ENV NODE_ENV=development
33
WORKDIR /usr/src/app
44
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]

cypress/e2e/server-page-spec.cy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe('Server page contains expected information', () => {
1313
'/api/error',
1414
];
1515
cy.visit('/');
16+
cy.get('[cy-data="server_version"]').contains('Version:');
1617
cy.get('[cy-data="server_status"]').contains('Running');
1718

1819
cy.get('[cy-data="server_address"]').contains('Server Address');

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"type": "module",
3+
"version": "2.2.2",
4+
"name": "mock-api-server",
5+
"description": "A mock API server for development and testing purposes.",
6+
"author": "piyook",
37
"scripts": {
48
"dev": "tsx watch ./src/server.ts",
59
"start": "docker compose up -d",

src/utilities/server-page.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const homePage = (apiPaths: string[]) => [
8989
}
9090
h1 {
9191
text-align: center;
92-
margin-bottom: 0.2em;
92+
9393
}
9494
.status-box {
9595
display: flex;
@@ -194,10 +194,19 @@ const homePage = (apiPaths: string[]) => [
194194
h1 {
195195
font-size: 2.4rem;
196196
font-weight: 700;
197-
margin: 0 0 12px 0;
198197
letter-spacing: 1px;
199198
text-align: center;
200199
}
200+
201+
h6 {
202+
text-align:right;
203+
font-style:italic;
204+
font-weight:normal;
205+
margin-top:0;
206+
margin-right:50px;
207+
color:var(--text-muted);
208+
}
209+
201210
.status {
202211
display: inline-block;
203212
color: #fff; /* Removed background here to be set dynamically */
@@ -361,6 +370,7 @@ const homePage = (apiPaths: string[]) => [
361370
</style>
362371
<main>
363372
<section class="info-sticky">
373+
<h6 cy-data="server_version">Version: ${process.env?.npm_package_version ?? 'N/A'}</h6>
364374
<h1>Mock Server</h1>
365375
<div class="status-box" cy-data="server_status">
366376
<span class="status" id="server-status">

0 commit comments

Comments
 (0)