A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Signup form | GET | /signup | ||||||||||||||||||||||||
2 | Display the signup view and respond with me set to null. | ||||||||||||||||||||||||||
3 | |||||||||||||||||||||||||||
4 | Incoming Params | Target Action | Response Type | ||||||||||||||||||||||||
5 | none | PageController.signup | html | ||||||||||||||||||||||||
6 | View | ||||||||||||||||||||||||||
7 | signup.ejs | Front-end Controller | |||||||||||||||||||||||||
8 | Locals: | signupPageController.js | |||||||||||||||||||||||||
9 | { "me": null } | ||||||||||||||||||||||||||
10 | |||||||||||||||||||||||||||
11 | Signup a user | POST | /user/signup | ||||||||||||||||||||||||
12 | Validate incoming params, encrypt password, create gravatar url, create user, create session, and respond with a username. | ||||||||||||||||||||||||||
13 | |||||||||||||||||||||||||||
14 | Params | Example | Target Action | Response Type | |||||||||||||||||||||||
15 | email (valid email) | sailsinaction@gmail.com | UserController.signup | json | |||||||||||||||||||||||
16 | password (> 5 characters) | abc123 | |||||||||||||||||||||||||
17 | username (> 5 characters) | sails-in-action | Front-end Controller | ||||||||||||||||||||||||
18 | n/a | ||||||||||||||||||||||||||
19 | Response | ||||||||||||||||||||||||||
20 | 200 OK | ||||||||||||||||||||||||||
21 | { username: 'sailsinaction' } | ||||||||||||||||||||||||||
22 | |||||||||||||||||||||||||||
23 | Signin form | GET | /signin | ||||||||||||||||||||||||
24 | Display the signin view and respond with me set to null. | ||||||||||||||||||||||||||
25 | Params | Target Action | Response Type | ||||||||||||||||||||||||
26 | none | PageController.signin | html | ||||||||||||||||||||||||
27 | View | ||||||||||||||||||||||||||
28 | signin.ejs | Front-end Controller | |||||||||||||||||||||||||
29 | signinPageController.js | ||||||||||||||||||||||||||
30 | Locals: | ||||||||||||||||||||||||||
31 | { "me": "null" } | ||||||||||||||||||||||||||
32 | |||||||||||||||||||||||||||
33 | Login | PUT | /login | ||||||||||||||||||||||||
34 | |||||||||||||||||||||||||||
35 | Params | Target Action | Response Type | ||||||||||||||||||||||||
36 | sailsinaction@gmail.com | UserController.login | status and custom mesage | ||||||||||||||||||||||||
37 | username | sails-in-action | |||||||||||||||||||||||||
38 | password | abc123 | Front-end Controller | ||||||||||||||||||||||||
39 | n/a | ||||||||||||||||||||||||||
40 | Responses | ||||||||||||||||||||||||||
41 | 403 Forbidden | 403 Forbidden | 200 OK | ||||||||||||||||||||||||
42 | "'Your our account has been deleted. Please visit http://brushfire.io/restore to restore your account.'" | "'Your our account has been banned, most likely for adding dog videos in violation of the Terms of Service. Please contact Chad or his mother.'" | create session | ||||||||||||||||||||||||
43 | |||||||||||||||||||||||||||
44 | Restore profile page | GET | /profile/restore | ||||||||||||||||||||||||
45 | Display the restore-profile view and respond with me set to null. | ||||||||||||||||||||||||||
46 | Params | Target Action | Response Type | ||||||||||||||||||||||||
47 | password | abc123 | PageController.restoreProfile | html | |||||||||||||||||||||||
48 | |||||||||||||||||||||||||||
49 | View | Front-end Controller | |||||||||||||||||||||||||
50 | restore-profile.ejs | restoreProfilePageController.js | |||||||||||||||||||||||||
51 | |||||||||||||||||||||||||||
52 | Locals: | ||||||||||||||||||||||||||
53 | 200 OK | ||||||||||||||||||||||||||
54 | "{ "me": null }" | ||||||||||||||||||||||||||
55 | |||||||||||||||||||||||||||
56 | Restore profile | PUT | /user/restore-profile | ||||||||||||||||||||||||
57 | Find user by email address, compare the password with the encrypted password and if they are the same, update the user's deleted attribute to false, create a session, and return username. | ||||||||||||||||||||||||||
58 | Params | Target Action | Response Type | ||||||||||||||||||||||||
59 | sailsinaction@gmail.com | UserController.restoreProfile | json | ||||||||||||||||||||||||
60 | password | abc123 | |||||||||||||||||||||||||
61 | Front-end Controller | ||||||||||||||||||||||||||
62 | Response | n/a | |||||||||||||||||||||||||
63 | 200 OK | ||||||||||||||||||||||||||
64 | { "username": "sails-in-action" } | ||||||||||||||||||||||||||
65 | |||||||||||||||||||||||||||
66 | Homepage | GET | / | ||||||||||||||||||||||||
67 | Display the homepage view which is a search form, display the add tutorial button, and respond with me set to null. | ||||||||||||||||||||||||||
68 | Params | Target Action | Response Type | ||||||||||||||||||||||||
69 | none | PageController.home | html | ||||||||||||||||||||||||
70 | View | ||||||||||||||||||||||||||
71 | homepage.ejs | Front-end Controller | |||||||||||||||||||||||||
72 | homePageController.js | ||||||||||||||||||||||||||
73 | Locals: | ||||||||||||||||||||||||||
74 | unauthenticated | authenticated | |||||||||||||||||||||||||
75 | { "me": "null" } | { "me": { "username": "sails-in-action", "gravatarURL": "http://gravtar.com/123213", "admin": true }, "showAddTutorialButton": true } | |||||||||||||||||||||||||
76 | |||||||||||||||||||||||||||
77 | Search results | GET | /tutorials/search | ||||||||||||||||||||||||
78 | List tutorials whose title or description match the specified search query. Paginate by10 records triggered by the show more tutorials button. | ||||||||||||||||||||||||||
79 | Params | Target Action | Response Type | ||||||||||||||||||||||||
80 | searchCriteria | crockford | TutorialController.searchTutorials | json | |||||||||||||||||||||||
81 | skip | 10 | |||||||||||||||||||||||||
82 | Front-end Controller | ||||||||||||||||||||||||||
83 | Response | n/a | |||||||||||||||||||||||||
84 | 200 OK | ||||||||||||||||||||||||||
85 | { "options": { "totalTutorials": 30, "updatedTutorials": { "id": 1 "title": "The best of Douglas Crockford on JavaScript.", "description": "Understanding JavaScript the good parts, and more.", "owner": "sails-in-action", "createdAt": "22 days ago", "totalTime": "3h 22m 23s", "stars": 4 } } } | ||||||||||||||||||||||||||
86 | |||||||||||||||||||||||||||
87 | Browse tutorials page | GET | /tutorials/browse | ||||||||||||||||||||||||
88 | Display the browse-tutorials view, show the add tutorial button, and respond with me set to null. | ||||||||||||||||||||||||||
89 | Params | Target Action | Response Type | ||||||||||||||||||||||||
90 | none | PageController.showBrowsePage | html | ||||||||||||||||||||||||
91 | View | ||||||||||||||||||||||||||
92 | browse-tutorials-list.ejs | Front-end Controller | |||||||||||||||||||||||||
93 | browseTutorialsPageController.js | ||||||||||||||||||||||||||
94 | Locals: | ||||||||||||||||||||||||||
95 | unauthenticated | authenticated | |||||||||||||||||||||||||
96 | { "me": "null" } | { "me": { "username": "sails-in-action", "gravatarURL": "http://gravtar.com/123213", "admin": true }, "showAddTutorialButton": true } | |||||||||||||||||||||||||
97 | |||||||||||||||||||||||||||
98 | Browse results | GET | /tutorials | ||||||||||||||||||||||||
99 | Get the first 10 tutorials. | ||||||||||||||||||||||||||
100 | Params | Target Action | Response Type |