express, knex, sqlite3, pg, nodemon, dotenv cross-env, cors bcryptjs, jsonwebtoken, jest, supertest
Base url: https://build-week-how-to-tt102.herokuapp.com/
Routes marked with (restricted) require Authorizaton header set with JWT
Base endpoint; Can be used to check if server is up
Returns:
"Welcome to the Server"
Registers a new user
Accepts:
{
username,
password,
}
Returns:
{
username,
id
}
Logs in a user
Accepts:
{
username,
password
}
Returns:
{
token: jwtToken,
message: "welcome ${username}",
id: userId
}
Gets an array of how-tos for a user
Returns:
[
{
id: howtoId,
title: howtoTitle,
description: howtoDescription
},
]
Gets a how-to by id for a user
Returns:
{
id: howtoId,
title: howtoTitle,
description: howtoDescription,
steps: [{
stepId,
step_number,
step_description
}]
}
Creates a new how-to for a user
Accepts:
{
title,
description,
steps(array, optional)
}
Returns:
{
id: howtoId,
title: howtoTitle,
description: howtoDescription,
steps: [{
stepId,
step_number,
step_description
}]
}
Updates a how-to by id (does not update steps)
Accepts:
{
title: changes,
description: changes
}
Returns:
{
id: howtoId,
title: howtoTitle,
description: howtoDescription
}
Deletes a how-to by id
Returns:
{
message: "How-To has been deleted"
}