From c7fbb0e4290ab6c0a2007730e43ef5d05c8d1f51 Mon Sep 17 00:00:00 2001 From: jmlee0622 <140807825+jmlee0622@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:11:56 +0900 Subject: [PATCH 1/2] Create main.yml --- .github/workflows/main.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c529b6d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,21 @@ +name: Node.js CI/CD + +on: + push: + branches: [ "master" ] + +jobs: + build: + runs-on: self-hosted + strategy: + matrix: + node-version: [20.x] + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm test From d4b2504314c3c6faa86cca8f712b4fe8206687ea Mon Sep 17 00:00:00 2001 From: Jongmin Lee Date: Fri, 17 Nov 2023 15:47:30 +0900 Subject: [PATCH 2/2] update app.js --- app.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app.js b/app.js index e8844ab..174b28e 100644 --- a/app.js +++ b/app.js @@ -1,17 +1,17 @@ // app.js -const http = require('http'); +const http = require("http"); -const hostname = '0.0.0.0'; +const hostname = "0.0.0.0"; const port = 3000; const server = http.createServer((req, res) => { res.statusCode = 200; - res.setHeader('Content-Type', 'text/plain'); - res.end('Hello, World!\n'); + res.setHeader("Content-Type", "text/plain"); + res.end("Hello, World!\n"); }); server.listen(port, hostname, () => { - console.log(`Server is running at http://${hostname}:${port}/`); + console.log(`Server running at http://${hostname}:${port}/`); }); module.exports = server;