-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.ts
29 lines (24 loc) · 789 Bytes
/
app.ts
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
import express, { Express, Request, Response, NextFunction } from 'express';
import log from './src/log'
import dbConnect from './src/db/database';
import routes from './src/routes';
import dotenv from 'dotenv';
import https from 'https';
dotenv.config();
const app: Express = express();
const PORT: String = process.env.PORT as string;
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.get('/', (req: Request, res: Response, next: NextFunction) => {
res.send('<b>Rusiru Abhisheak Portfolio API</b>');
next();
});
setInterval(function() {
https.get(process.env.API_PRODUCTION as string);
log.info('Root service called');
}, 900000)
app.listen(PORT, () => {
log.info(`API server up and running on PORT ${PORT}`);
dbConnect();
routes(app);
});