Method | Path | Header paramaters | URL parameters | Body parameters | Response on success | Response status on success |
---|---|---|---|---|---|---|
GET | /ping | pong |
200 | |||
POST | /bills | x-access-token | picture | Bill created |
201 | |
GET | /bills | x-access-token | List of bills IDs | 200 | ||
GET | /bills/billID | x-access-token | billID | Bill object | 200 | |
POST | /login | email, password | Credentials object | 200 | ||
POST | /users | email, password, username | Credentials object | 200 | ||
GET | /bills/web/link/details | link | Bill object | 200 | ||
GET | /bills/web/link | link | HTML file | 200 | ||
PUT | /bills/web/link | link | bill update object | Bill updated |
200 |
root
password to password
with
mysqladmin -u root -p password password
npm install
node server.js
Pong
password
. See the MySQL database section otherwise. npm install
Make sure you did the initial instructions of this Testing section first.
This allows you to test the server by sending HTTP requests to it on a temporary test database automatically created and destroyed. It tests every HTTP routes in every possible conditions. The tests are written using mocha and chai in tests/server-test.js
npm install -g mocha
node server.js test
The server will run on port 8001 with the database billsplittertest. You can stop it later by entering CTRL+C
mocha tests
Make sure you did the initial instructions of this Testing section first.
This allows you to see a HTML / Javascript webpage communicating with the backend. Each request to the server is coded in one of the functions in the HTML file tests/client.html
open -a Google\ Chrome --args --disable-web-security --user-data-dir
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security
google-chrome --disable-web-security
node server.js
The server will run on port 8000 with the database billsplitter.
You can stop it later by entering CTRL+C
Make sure you did the initial instructions of this Testing section first.