-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
32 lines (25 loc) · 943 Bytes
/
index.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
//written by VR
var express = require('express');
var app = express();
var router = express.Router();
var bodyParser = require('body-parser');
var url = require('url');
var apiRouter = require('./router');
var gateway = require('./app/gateway');
var transactionSale = require('./app/transactionSale');
var customerCreation = require('./app/customerCreation');
var subMerchantCreation = require('./app/subMerchantCreation');
var webhook = require('./app/webhook');
// views is directory for all template files
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname + '/public'));
app.use(bodyParser.urlencoded({ extended: false }));
app.get('/', function(req, res) {
res.render('pages/apiEndpoints');
});
app.use('/api', apiRouter);
app.listen(app.get('port'), function() {
console.log('Node app is running on port', app.get('port'));
});