Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
'use strict';
//temporary data for the items
const temp_item_data = [
{
id: "0001",
image: 'http://localhost:8080/img/items/' + '1' + '.png',
title : "cute girl dress",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"apparel",
location:"COVENTRY",
price:"8",
features:"feature 1\nfeature 2\nfeature 3",
condition:"new"
},
{
id: "0002",
image: 'http://localhost:8080/img/items/' + '2' + '.png',
title : "men cool jacket",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"apparel",
location:"COVENTRY",
price:"16",
features:"feature 1\nfeature 2\nfeature 3",
condition:"used"
},
{
id: "0003",
image: 'http://localhost:8080/img/items/' + '3' + '.png',
title : "men style shirt",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"apparel",
location:"LONDON",
price:"10",
features:"feature 1\nfeature 2\nfeature 3",
condition:"used"
},
{
id: "0004",
image: 'http://localhost:8080/img/items/' + '4' + '.png',
title : "3 Set Notebook",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"book",
location:"COVENTRY",
price:"7",
features:"feature 1\nfeature 2\nfeature 3",
condition:"new"
},
{
id: "0005",
image: 'http://localhost:8080/img/items/' + '5' + '.png',
title : "9 Set Slim Notebook",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"book",
location:"LONDON",
price:"8",
features:"feature 1\nfeature 2\nfeature 3",
condition:"new"
},
{
id: "0006",
image: 'http://localhost:8080/img/items/' + '6' + '.png',
title : "Bio David",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"book",
location:"COVENTRY",
price:"5",
features:"feature 1\nfeature 2\nfeature 3",
condition:"used"
},
{
id: "0007",
image: 'http://localhost:8080/img/items/' + '7' + '.png',
title : "Bio Llyod",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"book",
location:"COVENTRY",
price:"4",
features:"feature 1\nfeature 2\nfeature 3",
condition:"used"
},
{
id: "0008",
image: 'http://localhost:8080/img/items/' + '8' + '.png',
title : "Gaming 120Hz Monitor",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"electronic",
location:"LONDON",
price:"66",
features:"feature 1\nfeature 2\nfeature 3",
condition:"new"
},
{
id: "0009",
image: 'http://localhost:8080/img/items/' + '9' + '.png',
title : "Gaming PC 2016",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"electronic",
location:"LONDON",
price:"97",
features:"feature 1\nfeature 2\nfeature 3",
condition:"used"
},
{
id: "0010",
image: 'http://localhost:8080/img/items/' + '10' + '.png',
title : "Student PC for Graphics",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"electronic",
location:"COVENTRY",
price:"87",
features:"feature 1\nfeature 2\nfeature 3",
condition:"used"
},
{
id: "0011",
image: 'http://localhost:8080/img/items/' + '11' + '.png',
title : "Work Portable Laptop",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"electronic",
location:"COVENTRY",
price:"55",
features:"feature 1\nfeature 2\nfeature 3",
condition:"new"
},
{
id: "0012",
image: 'http://localhost:8080/img/items/' + '12' + '.png',
title : "Broom",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"household",
location:"LONDON",
price:"7",
features:"feature 1\nfeature 2\nfeature 3",
condition:"used"
},
{
id: "0013",
image: 'http://localhost:8080/img/items/' + '13' + '.png',
title : "Bike",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"household",
location:"COVENTRY",
price:"22",
features:"feature 1\nfeature 2\nfeature 3",
condition:"used"
},
{
id: "0014",
image: 'http://localhost:8080/img/items/' + '14' + '.png',
title : "2 pillows",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"household",
location:"LONDON",
price:"8",
features:"feature 1\nfeature 2\nfeature 3",
condition:"new"
},
{
id: "0015",
image: 'http://localhost:8080/img/items/' + '15' + '.png',
title : "home vaccuum",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"household",
location:"COVENTRY",
price:"14",
features:"feature 1\nfeature 2\nfeature 3",
condition:"new"
},
{
id: "0016",
image: 'http://localhost:8080/img/items/' + '16' + '.png',
title : "color pillow",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"household",
location:"LONDON",
price:"11",
features:"feature 1\nfeature 2\nfeature 3",
condition:"new"
},
{
id: "0017",
image: 'http://localhost:8080/img/items/' + '17' + '.png',
title : "bowl",
article: "Registered-trademark, say no to pirated products. ✔ HIGH QUALITY: 100% Genuine Leather.",
category:"kitchen",
location:"LONDON",
price:"2",
features:"feature 1\nfeature 2\nfeature 3",
condition:"used"
},
{
id: "0018",
image: 'http://localhost:8080/img/items/' + '18' + '.png',
title : "pan",
article: "Unique Thermospot technology lets the consumer.",
category:"kitchen",
location:"COVENTRY",
price:"5",
features:"feature 1\nfeature 2\nfeature 3",
condition:"used"
},
{
id: "0019",
image: 'http://localhost:8080/img/items/' + '19' + '.png',
title : "kitchen set",
article: "Optimum Hardness 59 HRC.",
category:"kitchen",
location:"COVENTRY",
price:"14.99",
features:"feature 1\nfeature 2\nfeature 3",
condition:"new"
}
];
exports.allRoutes = function (server) {
// get user information
server.get('/api/v1.0/items', (req, res) => {
res.setHeader('content-type', 'application/json');
res.setHeader('accepts', 'GET');
res.status(200);
res.end(JSON.stringify(temp_item_data));
});
server.get('/api/v1.0/login', (req, res) => {
console.log(req.query['username']);
//AUTHENTICATE HERE
//ON DEVELOPMENT
res.status(200);
res.end(JSON.stringify(res));
})
};