βββ app
β βββ controllers
β β βββ admin
β β β βββ posts.js
β β β βββ users.js
β β βββ posts.js
β β βββ session.js
π―
Reference: RFC 2616 - HTTP Status Code Definitions
- 400 BAD REQUEST: The request was invalid or cannot be otherwise served. An accompanying error message will explain further. For security reasons, requests without authentication are considered invalid and will yield this response.
- 401 UNAUTHORIZED: The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource.
- 403 FORBIDDEN: The request has been refused. See the accompanying message for the specific reason (most likely for exceeding rate limit).
- 404 NOT FOUND: The URI requested is invalid or the resource requested does not exists.
- 406 NOT ACCEPTABLE: The request specified an invalid format.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // # Mocha Guide to Testing | |
| // Objective is to explain describe(), it(), and before()/etc hooks | |
| // 1. `describe()` is merely for grouping, which you can nest as deep | |
| // 2. `it()` is a test case | |
| // 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run | |
| // before/after first/each it() or describe(). | |
| // | |
| // Which means, `before()` is run before first it()/describe() |