Skip to content

Instantly share code, notes, and snippets.

@wwdablu
Created October 6, 2019 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwdablu/a4d73dde1134edacb261ac446a936386 to your computer and use it in GitHub Desktop.
Save wwdablu/a4d73dde1134edacb261ac446a936386 to your computer and use it in GitHub Desktop.
var express = require('express');
var port = process.env.PORT || 3000;
var app = express();
app.get('/', function (req, res) {
res.send(JSON.stringify({ identity: 'Mockpress'}));
});
app.listen(port, function () {
console.log('Mockpress is listning...');
});
app.get('/vegetableprices', function (req, res) {
res.send(JSON.stringify({
content : [
{
id : 1,
name : "Potato",
price : "2.99",
image : "https://img.etimg.com/thumb/height-450,width-800,msid-68194731,imgsize-111140/gettyimages-909550520.jpg"
},
{
id : 2,
name : "Onion",
price : "1.99",
image : "https://cdn.thetruthaboutcancer.com/wp-content/uploads/20190125171422/red-onion-anti-cancer-benefit.jpg"
},
{
id : 3,
name : "Tomato",
price : "2.99",
image : "https://www.abelandcole.co.uk/media/7344_15922_z.jpg"
},
{
id : 4,
name : "Carrots",
price : "4.99",
image : "https://www.organicfacts.net/wp-content/uploads/storecarrots.jpg"
},
{
id : 5,
name : "Brocolli",
price : "7.99",
image : "https://www.cookforyourlife.org/wp-content/uploads/2018/08/shutterstock_294838064-min-696x520.jpg"
},
{
id : 6,
name : "Cucumber",
price : "0.99",
image : "https://www.shethepeople.tv/wp-content/uploads/2019/05/cucumber-e1558166231577.jpg"
},
{
id : 7,
name : "Lettuce",
price : "3.99",
image : "https://images-na.ssl-images-amazon.com/images/I/41CGtIyWgML.jpg"
},
{
id : 8,
name : "Brinjal",
price : "7.99",
image : "https://st1.thehealthsite.com/wp-content/uploads/2013/09/brinjal.jpg"
}
]
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment