This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function InventoryMock() { | |
this.inventory = []; | |
} | |
exports.InventoryMock = new InventoryMock(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var q = require('q'); | |
var mock = require('./mock/inventoryMock.js'); | |
function findInventory (id) { | |
var promise = q.defer(); | |
if(id){ | |
var filter = mock.InventoryMock.inventory.filter( | |
function(item){ | |
return item.guid === id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env node | |
var restify = require('restify'); | |
var port = process.env.NODE_PORT || 8081; | |
var ip = '127.0.0.1'; | |
//create servers | |
var server = restify.createServer(); | |
//create the handlers. | |
server.use(restify.CORS()); | |
server.use(restify.bodyParser({ mapParams: false })); |
NewerOlder