Creator: Yan Hong (http://onlyhongyan.com)
npm start or node server.js
POST
http://open-commerce.herokuapp.com/api/signup
Body
{
username: String,
password: String
}
POST
http://open-commerce.herokuapp.com/api/login
Body
{
username: String,
password: String
}
Response
{
"success": true,
"message": "Enjoy your token!",
"token": "TOKEN"
}
GET
http://open-commerce.herokuapp.com/api/products
Header
{
x-access-token: "TOKEN"
}
POST
http://open-commerce.herokuapp.com/api/products/:product_id
Header
{
x-access-token: "TOKEN"
}
POST
http://open-commerce.herokuapp.com/api/products
Header
{
x-access-token: "TOKEN"
}
Body
{
name: String,
description: String,
price: Number,
imageUrl: String,
stock: Number
}
PUT
http://open-commerce.herokuapp.com/api/products/:product_id
Header
{
x-access-token: "TOKEN"
}
Body
{
name: String,
description: String,
price: Number,
imageUrl: String,
stock: Number
}
DELETE
http://open-commerce.herokuapp.com/api/products/:product_id
Header
{
x-access-token: "TOKEN"
}
GET
http://open-commerce.herokuapp.com/api/orders
Header
{
x-access-token: "TOKEN"
}
POST
http://open-commerce.herokuapp.com/api/orders/
Header
{
x-access-token: "TOKEN"
}
Body
{
"products": [String]
}
GET
http://open-commerce.herokuapp.com/api/orders/:order_id
Header
{
x-access-token: "TOKEN"
}
PUT
http://open-commerce.herokuapp.com/api/orders/:order_id
Header
{
x-access-token: "TOKEN"
}
Body
{
"products": [String]
}
DELETE
http://open-commerce.herokuapp.com/api/orders/:order_id
Header
{
x-access-token: "TOKEN"
}