Example:
############################################# ar express = require('express'); var mockUris = require('../configurations/mock.json'); var cors = require('cors');
var app = express();
// declare server cross browser app.use(cors({ origin: '*', methods: 'GET, POST, PUT, DELETE', allowedHeaders: 'Content-Type,Authorization,If-Modified-Since' }));
/******************************************* MOCKS ENPOINTS ************************************************/ / poiFind */ app.get('/v1' + mockUris.generalConf.getPoiFind.split('v1')[1], function (req, res) { var pois = require('./data/poi/poi-search.json'); // the json response for the api call res.send(pois); });
/**************************************************** *******************************************************/ // declare server listener port var server = app.listen(9999, function () { console.log('mock server listening on port %d', server.address().port); });
################################
#create mockDate