Skip to content

Commit

Permalink
updating db configuration
Browse files Browse the repository at this point in the history
would work without a proper port.
  • Loading branch information
RA-Salles committed Aug 16, 2024
1 parent 8788636 commit 0939bc2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ function App() {
<div className="App">
<Router>
<Routes>
<Route path='*' element={<NotFound />} />
<Route path='*' element={<NotFound />} /> { /*equivalente a -> app.get()*/}
<Route path='/' element={<Home/>} />
<Route path='/cadastro' element={<Cadastro/>} />
<Route path='/login' element={<Login />} />
<Route path='/perfil' element={<Perfil />} />
<Route path='/republica' element={<Republica />} />
{ /*<Route path='/republica/*' element={<Republica id="checkurl"/>}>*/}
</Routes>
</Router>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/republica.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const Header = () => {
class republica extends React.Component {
constructor(props) {
super(props);
this.majorMalfunction = gatherRepublicInfo(props.id) //this will return an undefined. Very funny. FIXME.
this.majorMalfunction = getRepublicInfo(props.id) //this will return an undefined. Very funny. FIXME.
this.images = this.majorMalfunction.images
this.name = "very funny" //TODO
this.value = "IF YOU SEE THIS, THE DB AIN'T SENDING SHIT" //TODO
Expand Down
13 changes: 6 additions & 7 deletions src/databasescripts/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
Second: for security reasons, alter these functions if using for production.
Don't want any bad actors meddling with your data, yeah?
*/
var mysql = require("mysql");
const Pool = require("mysql").createPool;

var connection = mysql.createConnection({
var connection = new Pool({
port: 3306,
database: "unirepdb_basic",
host: "localhost",
user: "appdbfunctions",
password: "unirep"
})
});

connection.connect(function (err) {
if (err) throw err;
console.log("Connected!");
})
module.exports = connection;

0 comments on commit 0939bc2

Please sign in to comment.