'use strict';
var express = require('express');
var app = express();
const controllers = require('./controllers/controllersIndex.js');
const path = require('path');

app.use(express.static('public'));

app.get('/', function (req, res) {
  res.sendFile(path.join(__dirname + '/countries.html'));
});

//api for getting petition by petitionId
app.get('/api/petitions/all', function (req, res) {
  controllers.petitionController.getAllPetitionData((result) => {
    res.send(result);
  });
});

//api for getting petition by petitionId
app.get('/api/:petitionId', function (req, res) {
  controllers.petitionController.getPetitionData(req.params.petitionId, (result) => {
    res.send(result);
  });
});

app.listen(3000, function () {
  console.log('Example app listening on port 3000!');
});
@@ -691,24 +691,187 @@
 %0A  %7D);%0A%7D);%0A%0A
+%0Aapp.listen(process.env.PORT %7C%7C 3000, function()%7B%0A  console.log(%22Express server listening on port %25d in %25s mode%22, this.address().port, app.settings.env);%0A%7D);%0A%0A%0A// 
 app.listen(3
@@ -885,24 +885,27 @@
 nction () %7B%0A
+// 
   console.lo
@@ -946,11 +946,14 @@
 000!');%0A
+// 
 %7D);

fix port