-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
51 lines (43 loc) · 1.34 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const connection = require("./db/connection");
const add = require("./add/add");
const view = require("./view/view");
const deletD = require("./delete/delete");
const up = require("./update/update")
var inquirer = require("inquirer");
var figlet = require('figlet');
const chalk = require('chalk');
const cTable = require('console.table');
console.log(
chalk.greenBright.bgBlackBright(
figlet.textSync('Characters \n Inc', { horizontalLayout: 'full', verticalLayout: 'full' })
)
);
function firstDecision() {
inquirer
.prompt({
name: "first",
type: "list",
message: "Hello, what is your inquiry?",
choices: ["ADD", "VIEW", "UPDATE", "DELETE", "EXIT"]
}).then(function (answer) {
if (answer.first === "ADD") {
add.addData();
}
else if (answer.first === "VIEW") {
view.viewData();
}
else if (answer.first === "UPDATE") {
up.updateData();
}
else if (answer.first === "DELETE") {
deletD.deleteData();
}
else {
console.table("Goodbye!")
connection.end();
}
});
}
//Adding a department, role, or employee
exports.firstDecision = firstDecision;
firstDecision();