log
This commit is contained in:
parent
ce8bb41bda
commit
0f79425d65
17 changed files with 611 additions and 202 deletions
|
|
@ -9,6 +9,7 @@ import error from "./middlewares/error";
|
|||
import { AppDataSource } from "./database/data-source";
|
||||
import { RegisterRoutes } from "./routes";
|
||||
import { SalaryPeriodController } from "./controllers/SalaryPeriodController";
|
||||
import logMiddleware from "./middlewares/logs";
|
||||
|
||||
async function main() {
|
||||
await AppDataSource.initialize();
|
||||
|
|
@ -23,10 +24,11 @@ async function main() {
|
|||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use("/", express.static("static"));
|
||||
app.use(logMiddleware);
|
||||
app.use("/api-docs", swaggerUi.serve, swaggerUi.setup(swaggerDocument));
|
||||
|
||||
RegisterRoutes(app);
|
||||
|
||||
|
||||
app.use(error);
|
||||
const APP_HOST = process.env.APP_HOST || "0.0.0.0";
|
||||
const APP_PORT = +(process.env.APP_PORT || 3000);
|
||||
|
|
@ -35,7 +37,6 @@ async function main() {
|
|||
try {
|
||||
const salaryPeriod = new SalaryPeriodController();
|
||||
await salaryPeriod.CronjobSalaryPeriod();
|
||||
|
||||
} catch (error) {
|
||||
console.error("Error executing function from controller:", error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue