Skip to content

Commit 055f0d7

Browse files
committed
npm: add basic example from sample-nodejs-app
Migrate the basic npm sample from cachito-testing/sample-nodejs-app to doc-examples and adapt it to use Hermeto for npm dependencies. Signed-off-by: Vladimir Aleksandrov <valeksan@redhat.com>
1 parent 593f3bd commit 055f0d7

File tree

5 files changed

+641
-0
lines changed

5 files changed

+641
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.git
2+
node_modules
3+

Containerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:18
2+
3+
WORKDIR /src
4+
5+
COPY . .
6+
7+
RUN npm install --verbose
8+
9+
EXPOSE 9000
10+
11+
CMD ["node", "index.js"]
12+

index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
const express = require("express");
2+
3+
const port = 9000;
4+
const app = express();
5+
6+
app.get("/", (req, res) => res.send("Hello Dude!"));
7+
8+
app.listen(port, () => console.log(`App started on port ${port}...`));

0 commit comments

Comments
 (0)