ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1
Signup formGET/signup
2
Display the signup view and respond with me set to null.
3
4
Incoming ParamsTarget ActionResponse Type
5
nonePageController.signuphtml
6
View
7
signup.ejsFront-end Controller
8
Locals:signupPageController.js
9
{
"me": null
}
10
11
Signup a userPOST/user/signup
12
Validate incoming params, encrypt password, create gravatar url, create user, create session, and respond with a username.
13
14
ParamsExampleTarget ActionResponse Type
15
email (valid email)sailsinaction@gmail.comUserController.signupjson
16
password (> 5 characters)abc123
17
username (> 5 characters)sails-in-actionFront-end Controller
18
n/a
19
Response
20
200 OK
21
{
username: 'sailsinaction'
}
22
23
Signin formGET/signin
24
Display the signin view and respond with me set to null.
25
ParamsTarget ActionResponse Type
26
nonePageController.signinhtml
27
View
28
signin.ejsFront-end Controller
29
signinPageController.js
30
Locals:
31
{
"me": "null"
}
32
33
LoginPUT/login
34
35
ParamsTarget ActionResponse Type
36
emailsailsinaction@gmail.comUserController.loginstatus and custom mesage
37
usernamesails-in-action
38
passwordabc123Front-end Controller
39
n/a
40
Responses
41
403 Forbidden403 Forbidden200 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 pageGET/profile/restore
45
Display the restore-profile view and respond with me set to null.
46
ParamsTarget ActionResponse Type
47
passwordabc123PageController.restoreProfilehtml
48
49
ViewFront-end Controller
50
restore-profile.ejsrestoreProfilePageController.js
51
52
Locals:
53
200 OK
54
"{
"me": null
}"
55
56
Restore profilePUT
/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
ParamsTarget ActionResponse Type
59
emailsailsinaction@gmail.comUserController.restoreProfilejson
60
passwordabc123
61
Front-end Controller
62
Responsen/a
63
200 OK
64
{
"username": "sails-in-action"
}
65
66
HomepageGET/
67
Display the homepage view which is a search form, display the add tutorial button, and respond with me set to null.
68
ParamsTarget ActionResponse Type
69
nonePageController.homehtml
70
View
71
homepage.ejsFront-end Controller
72
homePageController.js
73
Locals:
74
unauthenticatedauthenticated
75
{
"me": "null"
}
{
"me": {
"username": "sails-in-action",
"gravatarURL": "http://gravtar.com/123213",
"admin": true
},
"showAddTutorialButton": true
}
76
77
Search resultsGET/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
ParamsTarget ActionResponse Type
80
searchCriteriacrockford
TutorialController.searchTutorials
json
81
skip10
82
Front-end Controller
83
Responsen/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 pageGET/tutorials/browse
88
Display the browse-tutorials view, show the add tutorial button, and respond with me set to null.
89
ParamsTarget ActionResponse Type
90
nonePageController.showBrowsePagehtml
91
View
92
browse-tutorials-list.ejsFront-end Controller
93
browseTutorialsPageController.js
94
Locals:
95
unauthenticatedauthenticated
96
{
"me": "null"
}
{
"me": {
"username": "sails-in-action",
"gravatarURL": "http://gravtar.com/123213",
"admin": true
},
"showAddTutorialButton": true
}
97
98
Browse resultsGET/tutorials
99
Get the first 10 tutorials.
100
ParamsTarget ActionResponse Type