Skip to content
Snippets Groups Projects
Commit 0079b9c5 authored by alrwasheda's avatar alrwasheda :speech_balloon:
Browse files

function calls + router to user-authentication added.

parent d7676b2e
No related branches found
No related tags found
No related merge requests found
...@@ -2,21 +2,28 @@ import "dotenv/config"; ...@@ -2,21 +2,28 @@ import "dotenv/config";
import express from "express"; import express from "express";
import showAllDBs from "./db/showAllDBs"; import showAllDBs from "./db/showAllDBs";
import showTables from "./db/showDBTables"; import showTables from "./db/showDBTables";
import showTableContent from "./db/showTableContent";
import initializeDatabase from "./db"; import initializeDatabase from "./db";
// import apiRouter from "./routes"; // import apiRouter from "./routes";
import sendMail from "./mail"; import sendMail from "./mail";
import router from "./routes";
import createGodWorker from "./db/createGodWorker";
let init = async () => { let init = async () => {
//DB
const sequelize = await initializeDatabase(); const sequelize = await initializeDatabase();
await createGodWorker();
// server
const app = express(); const app = express();
app.use(express.json()); app.use(express.json());
const port = process.env.PORT || 4000; const port = process.env.PORT || 4000;
app.listen(port, () => console.log(`Server listening on port: ${port}\n`)); app.listen(port, () => console.log(`Server listening on port: ${port}\n`));
app.get("/", (req, res) => res.send("hello in server")); app.get("/", (req, res) => res.send("hello in server"));
app.use("/", router);
//DB-information section
await showAllDBs(sequelize); await showAllDBs(sequelize);
await showTables(sequelize); await showTables(sequelize);
await showTableContent("worker", sequelize);
}; };
init().then(() => {}); init().then(() => {});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment