diff options
author | Michael Lando <ml636r@att.com> | 2017-06-09 03:19:04 +0300 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2017-06-09 03:19:04 +0300 |
commit | ed64b5edff15e702493df21aa3230b81593e6133 (patch) | |
tree | a4cb01fdaccc34930a8db403a3097c0d1e40914b /catalog-ui/SETTING-MOCK-SERVER.md | |
parent | 280f8015d06af1f41a3ef12e8300801c7a5e0d54 (diff) |
[SDC-29] catalog 1707 rebase commit.
Change-Id: I43c3dc5cf44abf5da817649bc738938a3e8388c1
Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/SETTING-MOCK-SERVER.md')
-rw-r--r-- | catalog-ui/SETTING-MOCK-SERVER.md | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/catalog-ui/SETTING-MOCK-SERVER.md b/catalog-ui/SETTING-MOCK-SERVER.md deleted file mode 100644 index 5db508f225..0000000000 --- a/catalog-ui/SETTING-MOCK-SERVER.md +++ /dev/null @@ -1,53 +0,0 @@ -# Prerequisites - -1. install [node.js](http://nodejs.org/download/) -2. install [git](http://git-scm.com/). __Make sure to select the option to add git into $PATH__ -3. install dependencies [express,cors] npm install express, npm install cors - - - -# Create the server file -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 - -1. create json file with the response. -2. add the api end point in the server file and declare the json file for the response/ - - - -# Running the server - -1. go to server file folder -2. run command : node <FileName> - |