-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverApi.js
50 lines (43 loc) · 1.47 KB
/
serverApi.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
/*############################################################################
#
# Module: serverApi.js
#
# Description:
# Endpoint implementation for Excel Plugin requests, initialize routes
#
# 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
############################################################################*/
// Import the constants from the 'constants' module
const appconst = require('./app/misc/constants');
// Import the 'express' module
const express = require('express');
// Import the 'body-parser' module
const bodyParser = require('body-parser');
// Create instance of the 'express' application
const app = express();
// Let the express application to use the
// middleware to parse JSON in the request body
app.use(bodyParser.json())
// Import the routes declared in the respective modules
require('./app/routes/keys.route.js')(app);
require('./app/routes/other.route.js')(app);
// Start the API Server to Listen to the given Port
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)
});