Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
route config is now options (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedireza authored Feb 8, 2018
1 parent 7098903 commit 36282a6
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 59 deletions.
22 changes: 11 additions & 11 deletions server/api/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/accounts',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -43,7 +43,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'POST',
path: '/api/accounts',
config: {
options: {
auth: {
scope: 'admin'
},
Expand All @@ -63,7 +63,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/accounts/{id}',
config: {
options: {
auth: {
scope: 'admin'
}
Expand All @@ -84,7 +84,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'PUT',
path: '/api/accounts/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -120,7 +120,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'DELETE',
path: '/api/accounts/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand All @@ -144,7 +144,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'PUT',
path: '/api/accounts/{id}/user',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -209,7 +209,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'DELETE',
path: '/api/accounts/{id}/user',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -260,7 +260,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'POST',
path: '/api/accounts/{id}/notes',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -300,7 +300,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'POST',
path: '/api/accounts/{id}/status',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -357,7 +357,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/accounts/my',
config: {
options: {
auth: {
scope: 'account'
}
Expand All @@ -375,7 +375,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'PUT',
path: '/api/accounts/my',
config: {
options: {
auth: {
scope: 'account'
},
Expand Down
12 changes: 6 additions & 6 deletions server/api/admin-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/admin-groups',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -42,7 +42,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'POST',
path: '/api/admin-groups',
config: {
options: {
auth: {
scope: 'admin'
},
Expand All @@ -65,7 +65,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/admin-groups/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand All @@ -89,7 +89,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'PUT',
path: '/api/admin-groups/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -127,7 +127,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'DELETE',
path: '/api/admin-groups/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -156,7 +156,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'PUT',
path: '/api/admin-groups/{id}/permissions',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down
18 changes: 9 additions & 9 deletions server/api/admins.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/admins',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -43,7 +43,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'POST',
path: '/api/admins',
config: {
options: {
auth: {
scope: 'admin'
},
Expand All @@ -66,7 +66,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/admins/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand All @@ -90,7 +90,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'PUT',
path: '/api/admins/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -132,7 +132,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'DELETE',
path: '/api/admins/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand All @@ -156,7 +156,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'PUT',
path: '/api/admins/{id}/groups',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -194,7 +194,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'PUT',
path: '/api/admins/{id}/permissions',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -232,7 +232,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'PUT',
path: '/api/admins/{id}/user',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -303,7 +303,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'DELETE',
path: '/api/admins/{id}/user',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down
2 changes: 1 addition & 1 deletion server/api/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'POST',
path: '/api/contact',
config: {
options: {
auth: false,
validate: {
payload: {
Expand Down
6 changes: 3 additions & 3 deletions server/api/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'POST',
path: '/api/login',
config: {
options: {
auth: false,
validate: {
payload: {
Expand Down Expand Up @@ -89,7 +89,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'POST',
path: '/api/login/forgot',
config: {
options: {
auth: false,
validate: {
payload: {
Expand Down Expand Up @@ -149,7 +149,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'POST',
path: '/api/login/reset',
config: {
options: {
auth: false,
validate: {
payload: {
Expand Down
4 changes: 2 additions & 2 deletions server/api/logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'DELETE',
path: '/api/logout',
config: {
options: {
auth: {
mode: 'try'
}
Expand All @@ -30,6 +30,6 @@ const register = function (server, serverOptions) {

module.exports = {
name: 'api-logout',
dependencies: ['auth', 'hapi-mongo-models'],
dependencies: ['auth', 'hapi-auth-basic', 'hapi-mongo-models'],
register
};
2 changes: 1 addition & 1 deletion server/api/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api',
config: {
options: {
auth: false
},
handler: function (request, h) {
Expand Down
8 changes: 4 additions & 4 deletions server/api/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/sessions',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -42,7 +42,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/sessions/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand All @@ -66,7 +66,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'DELETE',
path: '/api/sessions/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand All @@ -90,7 +90,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/sessions/my',
config: {
options: {
auth: {
scope: ['admin', 'account']
}
Expand Down
2 changes: 1 addition & 1 deletion server/api/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'POST',
path: '/api/signup',
config: {
options: {
auth: false,
validate: {
payload: {
Expand Down
10 changes: 5 additions & 5 deletions server/api/statuses.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/statuses',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -42,7 +42,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'POST',
path: '/api/statuses',
config: {
options: {
auth: {
scope: 'admin'
},
Expand All @@ -66,7 +66,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'GET',
path: '/api/statuses/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand All @@ -90,7 +90,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'PUT',
path: '/api/statuses/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down Expand Up @@ -125,7 +125,7 @@ const register = function (server, serverOptions) {
server.route({
method: 'DELETE',
path: '/api/statuses/{id}',
config: {
options: {
auth: {
scope: 'admin'
},
Expand Down
Loading

0 comments on commit 36282a6

Please sign in to comment.