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
54 changes: 48 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,62 @@ app.startQuestion = (closeConnectionCallback) => {

app.completeSentence = (continueCallback) => {
//YOUR WORK HERE

inquirer.prompt({
type: 'input',
message: 'What\'s your favorite color ?',
name: 'action'
}).then((res) => {
var color = res.action;

inquirer.prompt({
type: 'input',
message: 'What\'s your favorite item ?',
name: 'action'
}).then((res)=> {
console.log(color, res.action);
}).then(continueCallback);
})



console.log('Please write code for this function');

//End of your work
continueCallback();
//continueCallback();
}

app.createNewUser = (continueCallback) => {
//YOUR WORK HERE

console.log('Please write code for this function');
//End of your work
continueCallback();

inquirer.prompt({
type: 'input',
message: 'What\'s your name?',
name: 'action'
}).then((res) => {
var name = res.action;

inquirer.prompt({
type: 'input',
message: 'How old are you?',
name: 'action'
}).then((res) => {
var age = res.action;

inquirer.prompt({
type: 'input',
message: 'What\'s your gender?',
name: 'action'
}).then((res)=> {
console.log(name, age, res.action);
}).then(continueCallback);
})
})
}

// console.log('Please write code for this function');
//End of your work
// continueCallback();

app.searchEventful = (continueCallback) => {
//YOUR WORK HERE

Expand Down
18 changes: 18 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@

//require packages
const mysql = require("mysql");
const mySqlKey = require('./keys').mySql;
const app = require('./app')

//create MySQL connection
const connection = mysql.createConnection({
host: "localhost",
port: 3306,
user: "root",
password: mySqlKey,
database: "Eventonica"
});

const connection = require('./connection');
const app = require('./app');


const mySqlConnect = () => {
connection.connect((err) =>{
if (err) throw err;

console.log('Welcome to Eventonica')
console.log("connected as Administrator");

app.startQuestion(() => connection.end(), connection);

app.startQuestion(()=>{ connection.end() });
})
}
Expand Down
Loading