Replaced by contrax-backend
- Express: flexible, minimalist web framework for Node.js
- Meta-Auth: Express middleware for handling authentication w/ MetaMask
- Postgres: powerful, open source object-relational database system
- Knex: JS query builder compatible w/ various relational databases
- Helmet: Node module that helps in securing HTTP headers
- Cors: package for providing middleware to enable CORS
- Dotenv: module for loading environmental variables
- Nodemon: simple monitor script for Node.js development
- Pg: non-blocking PostgresSQL client for Node.js
- Sqlite3: self-contained relational database management system
- Supertest: library for testing Node.js HTTP servers
- Mocha: testing framework w/ browser support and asynchronous testing
- Chai: BDD/TDD assertion library for Node.js and the browser
-
- GET: retrieve address and issue challenge via meta-auth
- GET: verify message signature and check 'recovered' property
- GET: logout / disconnect wallet
-
- GET: retrieve all Favorites
- GET: retrieve a specific Favorite by ID
- GET: retrieve all Favorites for a specific user address
- POST: add a new Favorite
- PUT: update a specific Favorite by ID
- DELETE: remove a specific Favorite by ID
// TO DO: ADD SAMPLE CODE SNIPPET
// TO DO: ADD SAMPLE CODE SNIPPET
// TO DO: ADD SAMPLE CODE SNIPPET
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/json |
authorization |
String | Yes | JSON Web Token |
200 (OK)
The endpoint will return a HTTP response with a status code 200 and an array of objects containing all Favorites in the database.
// TO DO: ADD SAMPLE CODE SNIPPET
500(SERVER ERROR)
If there is a server or database error, the endpoint will return an HTTP response with a status code 500 and an object containing the following error message.
{
error: "Server failed to retrieve Favorites"
}
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/json |
authorization |
String | Yes | JSON Web Token |
200 (OK)
The endpoint will return a HTTP response with a status code 200 and an array containing a single Favorite object.
// TO DO: ADD SAMPLE CODE SNIPPET
404(CLIENT ERROR)
The endpoint will return a HTTP response with a status code 400 and an object containing the following error message.
{
"error": "No match found for the ID provided"
}
500(SERVER ERROR)
If there is a server or database error, the endpoint will return an HTTP response with a status code 500 and an object containing the following error message.
{
error: "Server failed to retrieve Favorite"
}
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/json |
authorization |
String | Yes | JSON Web Token |
200 (OK)
The endpoint will return a HTTP response with a status code 200 and an array containing the Favorites objects.
// TO DO: ADD SAMPLE CODE SNIPPET
404(CLIENT ERROR)
The endpoint will return a HTTP response with a status code 400 and an object containing the following error message.
{
"error": "No match found for the address provided"
}
500(SERVER ERROR)
If there is a server or database error, the endpoint will return an HTTP response with a status code 500 and an object containing the following error message.
{
error: "Server failed to retrieve data for the address provided"
}
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/json |
authorization |
String | Yes | JSON Web Token |
Name | Type | Required | Description |
---|---|---|---|
userAddress |
String | Yes | Associated user's public address |
favAddress |
String | Yes | Public address being saved and/or nicknamed |
favAlias |
String | Yes | Alias for the public address being stored |
// TO DO: ADD SAMPLE CODE SNIPPET
201 (Created)
The endpoint will return a HTTP response with status code 200 and an array containing the newly created Favorite object.
// TO DO: ADD SAMPLE CODE SNIPPET
500(SERVER ERROR)
If there is a server or database error, the endpoint will return an HTTP response with a status code 500 and an object containing the following error message.
{
error: "Server failed to add Favorite. Check for missing required field(s)"
}
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/json |
authorization |
String | Yes | JSON Web Token |
200 (OK)
The endpoint will return a HTTP response with a status code 200 and an object containing a success message and count of the number of Favorites updated.
{
message: "Favorite successfully updated",
count: 1
}
404(CLIENT ERROR)
The endpoint will return a HTTP response with a status code 400 and an object containing the following error message.
{
"error": "No match found for the ID provided"
}
500(SERVER ERROR)
If there is a server or database error, the endpoint will return an HTTP response with a status code 500 and an object containing the following error message.
{
error: "Server failed to update Favorite"
}
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes | Must be application/json |
authorization |
String | Yes | JSON Web Token |
200 (OK)
The endpoint will return a HTTP response with a status code 200 and an object containing the following message.
{
message: "Favorite successfully deleted"
}
404(CLIENT ERROR)
The endpoint will return a HTTP response with a status code 400 and an object containing the following error message.
{
"error": "No match found for the ID provided"
}
500(SERVER ERROR)
If there is a server or database error, the endpoint will return an HTTP response with a status code 500 and an object containing the following error message.
{
error: "Server failed to delete Favorite"
}