Produced by Araxis Merge on 10/2/2017 1:40:10 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | chef-repo.zip\chef-repo\project_cookbooks\mocks\files\default\node-mocks\nodeMockServices-1.3.0.52.zip | mock-server.js | Fri Apr 24 20:10:02 2015 UTC |
| 2 | chef-repo.zip\chef-repo\project_cookbooks\mocks\files\default\node-mocks\nodeMockServices-1.3.0.52.zip | mock-server.js | Mon Oct 2 12:54:07 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 140 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | /*jslint n ode: true */ | |
| 2 | 'use stric t'; | |
| 3 | ||
| 4 | var expres s = requir e('express '); | |
| 5 | var app = express(); | |
| 6 | var bodyPa rser = req uire('body -parser'); | |
| 7 | var bunyan = require ('bunyan') ; | |
| 8 | app.config = require ('./config .js'); | |
| 9 | var mockHd rProcess = require(' ./mockHdrP rocess.js' ); | |
| 10 | var mockMv iProcess = require(' ./mockMviP rocess.js' ); | |
| 11 | var mockVh icProcess = require( './mockVhi cProcess.j s'); | |
| 12 | var logger = bunyan. createLogg er(app.con fig.logger ); | |
| 13 | ||
| 14 | var bad_re quest = 40 0; | |
| 15 | var expect ed_templat e = 'Gener icObservat ionRead1'; | |
| 16 | var expect ed_filter = 'GENERIC _VISTA_LIS T_DATA_FIL TER'; | |
| 17 | var expect ed_type = 'json'; | |
| 18 | ||
| 19 | app.use(bo dyParser.j son()); | |
| 20 | app.use(bo dyParser.u rlencoded( )); | |
| 21 | ||
| 22 | app.get('/ repositori es. URL /fpds/:dom ain', func tion(req, res) { | |
| 23 | var te mplateId = req.param ('template Id'); | |
| 24 | var fi lterId = r eq.param(' filterId') ; | |
| 25 | var cl ientName = req.param ('clientNa me'); | |
| 26 | var ty pe = req.p aram('_typ e'); | |
| 27 | ||
| 28 | var me ssage = '' ; | |
| 29 | if ((! templateId ) || (temp lateId != expected_t emplate)) { | |
| 30 | me ssage = ap pendToMess age(messag e, 'Bad te mplateId-- expected ' + expecte d_template + ' but f ound ' + t emplateId) ; | |
| 31 | } | |
| 32 | if ((! filterId) || (filter Id != expe cted_filte r)) { | |
| 33 | me ssage = ap pendToMess age(messag e, 'Bad fi lterId--ex pected ' + expected_ filter + ' but found ' + filte rId); | |
| 34 | } | |
| 35 | if (!c lientName) { | |
| 36 | me ssage = ap pendToMess age(messag e, 'Missin g required parameter clientNam e'); | |
| 37 | } | |
| 38 | if ((t ype) && (t ype != exp ected_type )) { | |
| 39 | me ssage = ap pendToMess age(messag e, 'Reques ted dataty pe of ' + type + ' i s not supp orted'); | |
| 40 | } | |
| 41 | ||
| 42 | if (me ssage != ' ') { | |
| 43 | lo gger.error (message); | |
| 44 | re s.status(b ad_request ).send(mes sage); | |
| 45 | } else { | |
| 46 | va r pid = re q.param('n ationalId' ); | |
| 47 | va r domain = req.param s.domain; | |
| 48 | lo gger.debug ('Received request f or ' + dom ain + ' fo r ' + pid) ; | |
| 49 | ||
| 50 | mo ckHdrProce ss.fetchHd rData(pid, domain, r es); | |
| 51 | } | |
| 52 | }); | |
| 53 | ||
| 54 | app.post(' /mvi', fun ction(req, res) { | |
| 55 | mockMv iProcess.f etchMviDat a(req, res ); | |
| 56 | }); | |
| 57 | ||
| 58 | app.post(' /vhic', fu nction(req , res) { | |
| 59 | mockVh icProcess. fetchVhicD ata(req, r es); | |
| 60 | }); | |
| 61 | ||
| 62 | var server = app.lis ten(app.co nfig.port, function( ) { | |
| 63 | logger .info('Lis tening on port %d', server.add ress().por t); | |
| 64 | }); | |
| 65 | ||
| 66 | function a ppendToMes sage(messa ge, append ix) { | |
| 67 | if (me ssage == ' ') { | |
| 68 | re turn appen dix; | |
| 69 | } | |
| 70 | return message + '; ' + ap pendix; | |
| 71 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.