Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // DATABASE
- const mysql = require("mysql");
- var config = {
- host: "localhost",
- port: 3306,
- database: "minesweeper",
- user: "root",
- password: "",
- };
- const Q = {
- SELECT_PASSWORD_FOR_USERNAME :"SELECT password from login where username = ?",
- };
- var connection = mysql.createConnection(config);
- connection.connect();
- app.post("/doLogin",(req,res) => {
- // res.send("You sent the name " + req.body.username + ".");
- connection.query(Q.SELECT_PASSWORD_FOR_USERNAME, req.body.username ,function(err, result) {
- if(result.)
- if (err) return console.log(err);
- else{
- res.sendFile(__dirname+"/public/index.html");
- console.log("hallo")
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement