@@ -9,31 +9,31 @@ const port = 3000;
9
9
app . use ( bodyParser . json ( ) ) ;
10
10
11
11
// 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
+ // });
18
18
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.');
22
22
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
+ // `;
31
31
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
+ // });
37
37
38
38
39
39
// Endpoint to get all favorites
0 commit comments