diff --git a/server/src/server.ts b/server/src/server.ts index d0295b31e83f3749d7e972107f809c7ed5d000de..a6a144909c50db4355eaa4b5ce10339df874e0c5 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -2,21 +2,28 @@ import "dotenv/config"; import express from "express"; import showAllDBs from "./db/showAllDBs"; import showTables from "./db/showDBTables"; +import showTableContent from "./db/showTableContent"; import initializeDatabase from "./db"; // import apiRouter from "./routes"; import sendMail from "./mail"; +import router from "./routes"; +import createGodWorker from "./db/createGodWorker"; let init = async () => { + //DB const sequelize = await initializeDatabase(); - + await createGodWorker(); + // server const app = express(); app.use(express.json()); const port = process.env.PORT || 4000; app.listen(port, () => console.log(`Server listening on port: ${port}\n`)); app.get("/", (req, res) => res.send("hello in server")); - + app.use("/", router); + //DB-information section await showAllDBs(sequelize); await showTables(sequelize); + await showTableContent("worker", sequelize); }; init().then(() => {});