Skip to content

add lai week 5 #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Phase-1-Practices/Week-5/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:14

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm install

COPY . .

EXPOSE 3000

CMD [ "node", "app.js" ]
15 changes: 15 additions & 0 deletions Phase-1-Practices/Week-5/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
pipeline {
agent any
stage {
stage ('setup') {
checkout scm
}
stage ('Build') {
sh 'npm install'
}
stage ('Test') {
sh 'mocha test'
}
}

}
13 changes: 13 additions & 0 deletions Phase-1-Practices/Week-5/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var express = require('express');
var app = express();

app.get('/', function (req, res) {
res.send('Hello World!');
});

var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;

console.log('Example app listening at http://%s:%s', host, port);
});
Loading