-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
39 lines (30 loc) · 972 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
/*
* This program and the accompanying materials are made available under the terms of the
* Eclipse Public License v2.0 which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-v20.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Copyright Contributors to the Zowe Project.
*
*/
const express = require('express');
const cookieParser = require('cookie-parser');
const logger = require('morgan');
const cors = require('cors');
require('dotenv').config();
require('./db');
const indexRouter = require('./routes/index');
const app = express();
app.set('trust proxy', 1);
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(cors());
app.use('/api', indexRouter);
const CronJob = require('cron').CronJob;
const { generateReport } = require('./methods/pdf');
let job = new CronJob('1 0 1 * *', generateReport);
job.start();
module.exports = app;