-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
60 lines (48 loc) · 1.56 KB
/
server.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*############################################################################
#
# Module: server.js
#
# Description:
# DNC Server Module (Backend for DNC UI, DNC Endpoints)
#
# Copyright notice:
# This file copyright (c) 2021 by
#
# MCCI Corporation
# 3520 Krums Corners Road
# Ithaca, NY 14850
#
# Released under the MCCI Corporation.
#
# Author:
# Seenivasan V, MCCI Corporation February 2021
#
# Revision history:
# V1.0.0 Fri Oct 22 2021 11:24:35 seenivasan
# Module created
############################################################################*/
const cors = require('cors');
const express = require('express');
const dbConfig = require('./config/dbconfig.js');
const appconst = require('./app/misc/constants.js');
const bodyParser = require('body-parser');
const app = express();
app.use(cors());
// parse requests of content-type - application/json
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }));
require('./app/routes/client.route.js')(app);
require('./app/routes/device.route.js')(app);
require('./app/routes/dnc.route.js')(app);
require('./app/routes/ui.route.js')(app);
require('./app/routes/devreg.route.js')(app);
require('./app/routes/config.route.js')(app);
require('./app/version.js')(app);
global.reqCnt = 0;
global.tagreq = "";
dbConfig.dbInit();
var server = app.listen(appconst.APP_PORT, function () {
var host = server.address().address
var port = server.address().port
console.log(""+appconst.APP_NAME+" v"+appconst.APP_VERSION+" Listening http://%s:%s", host, port)
});