Skip to content
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
24 changes: 24 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
let mysql = require("mysql");

let con = mysql = mysql.createConnection({
host: "localhost",
user: "root",
password: "password",
database: "pokedb"

let uniqueType = new Set();
data.forEach(pokemon => {
pokemon.uniqueType.add(type);
})
})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to drop this logic, i'm not seeing the values being used anywhere. The unique type logic was used in the loading the database logic

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

con.connect((err) => {
if (err) {
throw err;
}
con.query("SELECT * FROM pokemon", (err, result, fields) => {
if (err) {
throw err;
}
console.log(result);
});
});
77 changes: 70 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"homepage": "https://github.com/code-differently/Pokedex-App#readme",
"dependencies": {
"express": "^4.17.1"
"express": "^4.17.1",
"mysql": "^2.18.1"
}
}