Migrasi dan pengelolaan infrastruktur cloud yang efisien dan skalabel untuk bisnis Anda.
+
+
+
+
+
+
+
Cyber Security
+
Lindungi data aset berharga Anda dari ancaman siber dengan sistem keamanan berlapis.
+
+
+
+
+
+
+
Software Development
+
Pengembangan aplikasi kustom yang dirancang khusus untuk memenuhi kebutuhan operasional.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Mengapa Memilih TechConsult?
+
+ Dengan pengalaman lebih dari 10 tahun, kami memahami bahwa setiap bisnis memiliki tantangan unik. Kami tidak hanya memberikan teknologi, tapi memberikan solusi strategis yang membantu Anda tumbuh.
+
+
+
+
+ Tim Ahli Tersertifikasi Internasional
+
+
+
+ Dukungan Teknis 24/7
+
+
+
+ Pendekatan Berbasis Data & Hasil
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/public/index2.html b/app/public/index2.html
new file mode 100644
index 000000000..8fd99627e
--- /dev/null
+++ b/app/public/index2.html
@@ -0,0 +1 @@
+test branch
\ No newline at end of file
diff --git a/public/stylesheet/style.css b/app/public/stylesheet/style.css
similarity index 100%
rename from public/stylesheet/style.css
rename to app/public/stylesheet/style.css
diff --git a/app/testing/app.test.js b/app/testing/app.test.js
new file mode 100644
index 000000000..2f74fbdf1
--- /dev/null
+++ b/app/testing/app.test.js
@@ -0,0 +1,44 @@
+const request = require('supertest');
+const mysql = require('mysql');
+require('dotenv').config();
+
+const connection = require('../middleware/db_connect');
+const app = require('../app'); // Replace with the path to your application file
+
+describe('Unit Test /', () => {
+ it('should respond with index.html', async () => {
+ const response = await request(app).get('/');
+ expect(response.status).toBe(200);
+ });
+});
+
+describe('Unit Test /app1', () => {
+ it('should respond with "Hello App1!"', async () => {
+ const response = await request(app).get('/app1');
+ expect(response.status).toBe(200);
+ });
+ });
+
+ describe('Unit Test /app2', () => {
+ it('should respond with "Hello App2!"', async () => {
+ const response = await request(app).get('/app2');
+ expect(response.status).toBe(200);
+ });
+ });
+
+describe('Integration Test Connect Database', () => {
+ beforeEach(() => {
+ // Set the connection for the application to use
+ app.set('connection', connection.connect);
+ });
+
+ afterEach(() => {
+ // Close the connection pool after the tests are done
+ connection.end();
+ });
+
+ it('should respond with users data', async () => {
+ const response = await request(app).get('/users');
+ expect(response.status).toBe(200);
+ });
+});
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 000000000..407fb538b
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,13 @@
+name: app
+
+services:
+ app:
+ image: ahmadsolihin/simple-app:1.0
+ build: ./app
+ ports:
+ - "5000:3000"
+ volumes:
+ - vol-upload:/app/public/images/
+
+volumes:
+ vol-upload:
\ No newline at end of file
diff --git a/middleware/db_connect.js b/middleware/db_connect.js
deleted file mode 100644
index 16ed286a2..000000000
--- a/middleware/db_connect.js
+++ /dev/null
@@ -1,11 +0,0 @@
-const mysql = require('mysql')
-
-// Connect database
-const connection = mysql.createConnection({
- host: '172.17.0.2',
- user: 'peserta',
- password: 'password',
- database: 'training'
-})
-
-module.exports = connection
\ No newline at end of file
diff --git a/public/index.html b/public/index.html
deleted file mode 100644
index d6785c439..000000000
--- a/public/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
- Training DevOps
-
-
-
-
-
Belajar Devops
-
-
\ No newline at end of file
diff --git a/testing/app.test.js b/testing/app.test.js
deleted file mode 100644
index 178167f52..000000000
--- a/testing/app.test.js
+++ /dev/null
@@ -1,26 +0,0 @@
-const request = require('supertest')
-const express = require('express')
-
-// Import the app file
-const app = require('../app')
-
-describe('Test /', () => {
- it('should respond with index.html', async () => {
- const response = await request(app).get('/');
- expect(response.status).toBe(200);
- });
-});
-
-describe('Test /app1', () => {
- it('should respond with "Hello App1!"', async () => {
- const response = await request(app).get('/');
- expect(response.status).toBe(200);
- });
- });
-
- describe('Test /app2', () => {
- it('should respond with "Hello App2!"', async () => {
- const response = await request(app).get('/');
- expect(response.status).toBe(200);
- });
- });
\ No newline at end of file
diff --git a/testing/db.test.js b/testing/db.test.js
deleted file mode 100644
index 8f9936cc2..000000000
--- a/testing/db.test.js
+++ /dev/null
@@ -1,41 +0,0 @@
-const request = require('supertest');
-const mysql = require('mysql');
-const { expect } = require('chai');
-
-const connection = require('../middleware/db_connect');
-const app = require('../app'); // Replace with the path to your application file
-
-describe('Integration Test', () => {
- let connection;
-
- beforeEach(() => {
- // Create a connection pool instead of a single connection
- connection = mysql.createPool({
- connectionLimit: 10, // Adjust the limit according to your requirements
- host: '172.17.0.2',
- user: 'peserta',
- password: 'password',
- database: 'training'
- });
-
- // Set the connection for the application to use
- app.set('connection', connection);
- });
-\
- afterEach(() => {
- // Close the connection pool after the tests are done
- connection.end();
- });
-
- it('should connect to the MySQL database', (done) => {
- request(app)
- .get('/users') // Replace with the endpoint you want to test
- .expect(200)
- .end((err, res) => {
- expect(err).to.be.null;
- expect(res.status).to.equal(200);
- // Additional assertions based on your application's response
- done();
- });
- });
-});
\ No newline at end of file