-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
42 lines (34 loc) · 994 Bytes
/
app.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
import express from "express";
import { Sequelize } from "sequelize";
import { connection } from "./Models/connection.js";
import xlsxfile from "read-excel-file/node/index.commonjs.js";
import Excel from "exceljs";
import { userRegister } from "./Createtable.js/create.js";
const wb = new Excel.Workbook();
const ws = wb.addWorksheet("Book.xlsx");
const app = express();
const port = 3029;
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
connection
.authenticate()
.then(() => {
console.log("");
console.log(`Database Authenticated`);
// connection.sync({ force: false });
console.log("");
})
.catch((error) => {
console.log(`Database Authentication Error`);
});
export var count;
export var array = [];
var master = [];
xlsxfile("./Book.xlsx").then((rows) => {
// console.log(rows[0]);
console.log("rows", rows);
userRegister(rows[0], rows);
});
app.listen(port, () => {
console.log(`App listening on port ${port}`);
});