Skip to content

Commit ba76b34

Browse files
authored
Zakomentarisana konekcija na bazu od linije 12 do 37
1 parent be5874f commit ba76b34

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

4-network/app.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,31 @@ const port = 3000;
99
app.use(bodyParser.json());
1010

1111
// MySQL connection setup
12-
const connection = mysql.createConnection({
13-
host: process.env.DB_HOST || '172.17.0.1', //ovde staviti svoju IP adresu
14-
user: 'novi',
15-
password: 'novi',
16-
database: 'swfavorites'
17-
});
12+
// const connection = mysql.createConnection({
13+
// host: process.env.DB_HOST || '172.17.0.1', //ovde staviti svoju IP adresu
14+
// user: 'novi',
15+
// password: 'novi',
16+
// database: 'swfavorites'
17+
// });
1818

19-
connection.connect(err => {
20-
if (err) throw err;
21-
console.log('Connected to the database.');
19+
// connection.connect(err => {
20+
// if (err) throw err;
21+
// console.log('Connected to the database.');
2222

23-
const createTableSql = `
24-
CREATE TABLE IF NOT EXISTS favorites (
25-
id INT AUTO_INCREMENT PRIMARY KEY,
26-
name VARCHAR(100) NOT NULL,
27-
type VARCHAR(100) NOT NULL,
28-
url VARCHAR(100) NOT NULL
29-
)
30-
`;
23+
// const createTableSql = `
24+
// CREATE TABLE IF NOT EXISTS favorites (
25+
// id INT AUTO_INCREMENT PRIMARY KEY,
26+
// name VARCHAR(100) NOT NULL,
27+
// type VARCHAR(100) NOT NULL,
28+
// url VARCHAR(100) NOT NULL
29+
// )
30+
// `;
3131

32-
connection.query(createTableSql, (err, result) => {
33-
if (err) throw err;
34-
console.log("Table 'favorites' is ready.");
35-
});
36-
});
32+
// connection.query(createTableSql, (err, result) => {
33+
// if (err) throw err;
34+
// console.log("Table 'favorites' is ready.");
35+
// });
36+
// });
3737

3838

3939
// Endpoint to get all favorites

0 commit comments

Comments
 (0)