A RESTful API built with Express and Knex to support the PalettePicker Front-End UI.
(Deployed at https://palette-picker-jbbc.herokuapp.com)
GET /api/v1/projects
Name | Type | Description |
---|---|---|
name |
string |
Search projects by name (case-sensitive) |
Status: 200 OK
[
{
id: 1,
project_name: "My First Project",
created_at: "2019-07-02T23:49:14.977Z",
updated_at: "2019-07-02T23:49:14.977Z"
},
{
id: 2,
project_name: "My Second Project",
created_at: "2019-07-02T23:49:14.997Z",
updated_at: "2019-07-02T23:49:14.997Z"
},
...
]
GET /api/v1/palettes
Name | Type | Description |
---|---|---|
project_id |
integer |
Search palettes by thier associated project |
Status: 200 OK
[
{
id: 1,
palette_name: "My First Palette",
color1: "#d70693",
color2: "#484336",
color3: "#d28404",
color4: "#ac0f0a",
color5: "#c8aaed",
project_id: 1,
created_at: "2019-07-02T23:49:15.003Z",
updated_at: "2019-07-02T23:49:15.003Z"
},
{
id: 2,
palette_name: "My Second Palette",
color1: "#91e214",
color2: "#84474c",
color3: "#37fb59",
color4: "#2eb501",
color5: "#452a06",
project_id: 1,
created_at: "2019-07-02T23:49:15.010Z",
updated_at: "2019-07-02T23:49:15.010Z"
},
...
]
GET /api/v1/projects/:id
None
Status: 200 OK
{
id: 1,
project_name: "My First Project",
created_at: "2019-07-02T23:49:14.977Z",
updated_at: "2019-07-02T23:49:14.977Z"
}
GET /api/v1/palette/:id
None
Status: 200 OK
{
id: 1,
palette_name: "My First Palette",
color1: "#d70693",
color2: "#484336",
color3: "#d28404",
color4: "#ac0f0a",
color5: "#c8aaed",
project_id: 1,
created_at: "2019-07-02T23:49:15.003Z",
updated_at: "2019-07-02T23:49:15.003Z"
}
POST /api/v1/project
Name | Type | Description |
---|---|---|
project_name |
string |
Name of the project |
Status: 201 Created
{
id: 17
}
POST /api/v1/palettes
Name | Type | Description |
---|---|---|
palette_name |
string |
Name of the palette |
color1 |
string |
Six-digit hexcode |
color2 |
string |
Six-digit hexcode |
color3 |
string |
Six-digit hexcode |
color4 |
string |
Six-digit hexcode |
color5 |
string |
Six-digit hexcode |
project_id |
integer |
ID of associated project |
Status: 201 Created
{
id: 32
}
PUT /api/v1/project/:id
Name | Type | Description |
---|---|---|
project_name |
string |
Name of the project |
Status: 204 No Content
PUT /api/v1/palettes/:id
Name | Type | Description |
---|---|---|
palette_name |
string |
Name of the palette |
color1 |
string |
Six-digit hexcode |
color2 |
string |
Six-digit hexcode |
color3 |
string |
Six-digit hexcode |
color4 |
string |
Six-digit hexcode |
color5 |
string |
Six-digit hexcode |
project_id |
integer |
ID of associated project |
Status: 204 No Content
DELETE /api/v1/projects/:id
Status: 204 No Content
DELETE /api/v1/palettes/:id
Status: 204 No Content