@webresto/graphql 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/additionalResolvers.js +1 -1
- package/src/additionalResolvers.ts +1 -1
- package/src/graphql.js +40 -22
- package/src/graphql.ts +42 -25
- package/src/resolvers/cart.d.ts +225 -7
- package/src/resolvers/cart.js +21 -7
- package/src/resolvers/cart.ts +23 -8
- package/src/resolvers/checkout.ts +1 -0
- package/test/{_bootstrap.js → bootstrap.js} +6 -7
- package/test/bootstrap.ts +3 -0
- package/test/fixture/.sailsrc +14 -0
- package/test/fixture/api/controllers/.gitkeep +0 -0
- package/test/fixture/api/models/.gitkeep +0 -0
- package/test/fixture/api/services/.gitkeep +0 -0
- package/test/fixture/app-export.js +73 -73
- package/test/fixture/app.js +56 -56
- package/test/fixture/config/adminpanel.js +25 -3
- package/test/fixture/config/bootstrap.js +161 -0
- package/test/fixture/config/connections.js +9 -9
- package/test/fixture/config/env/development.js +10 -10
- package/test/fixture/config/env/production.js +16 -16
- package/test/fixture/config/globals.js +16 -16
- package/test/fixture/config/hookTimeout.js +8 -8
- package/test/fixture/config/http.js +93 -93
- package/test/fixture/config/i18n.js +57 -57
- package/test/fixture/config/log.js +29 -29
- package/test/fixture/config/models.js +8 -8
- package/test/fixture/config/modulemanager.js +22 -22
- package/test/fixture/config/policies.js +51 -51
- package/test/fixture/config/routes.js +49 -49
- package/test/fixture/config/session.js +100 -100
- package/test/fixture/config/sockets.js +141 -141
- package/test/fixture/config/views.js +94 -94
- package/test/fixture/hacks/waterline.js +39 -0
- package/test/fixture/package.json +33 -30
- package/test/fixture/seeds/dish.json +37042 -0
- package/test/fixture/seeds/group.json +1418 -0
- package/test/fixture/seeds/iikoDiscount.json +365 -0
- package/test/fixture/views/403.ejs +68 -68
- package/test/fixture/views/404.ejs +68 -68
- package/test/fixture/views/500.ejs +73 -73
- package/test/fixture/views/homepage.ejs +74 -74
- package/test/fixture/views/layout.ejs +91 -91
- package/test/integration/graphql.test.js +11 -0
- package/test/integration/graphql.test.ts +15 -0
- package/test/{unit → integration}/sails_not_crash.test.js +0 -0
- package/test/{unit → integration}/sails_not_crash.test.ts +0 -0
- package/test/unit/first.test.js +1 -1
- package/test/unit/first.test.ts +1 -1
- package/test/fixture/.tmp/localDiskDb/archive.db +0 -1
- package/test/fixture/.tmp/localDiskDb/dish.db +0 -1
- package/test/fixture/.tmp/localDiskDb/dish_images__image_dish.db +0 -1
- package/test/fixture/.tmp/localDiskDb/group.db +0 -1
- package/test/fixture/.tmp/localDiskDb/group_images__image_group.db +0 -1
- package/test/fixture/.tmp/localDiskDb/image.db +0 -1
- package/test/fixture/.tmp/localDiskDb/maintenance.db +0 -1
- package/test/fixture/.tmp/localDiskDb/order.db +0 -1
- package/test/fixture/.tmp/localDiskDb/orderdish.db +0 -1
- package/test/fixture/.tmp/localDiskDb/paymentdocument.db +0 -1
- package/test/fixture/.tmp/localDiskDb/paymentmethod.db +0 -2
- package/test/fixture/.tmp/localDiskDb/place.db +0 -1
- package/test/fixture/.tmp/localDiskDb/settings.db +0 -2
- package/test/fixture/.tmp/localDiskDb/street.db +0 -1
- package/test/fixture/package-lock.json +0 -9805
- package/test.zip +0 -0
@@ -1,93 +1,93 @@
|
|
1
|
-
/**
|
2
|
-
* HTTP Server Settings
|
3
|
-
* (sails.config.http)
|
4
|
-
*
|
5
|
-
* Configuration for the underlying HTTP server in Sails.
|
6
|
-
* Only applies to HTTP requests (not WebSockets)
|
7
|
-
*
|
8
|
-
* For more information on configuration, check out:
|
9
|
-
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.http.html
|
10
|
-
*/
|
11
|
-
|
12
|
-
module.exports.http = {
|
13
|
-
|
14
|
-
/****************************************************************************
|
15
|
-
* *
|
16
|
-
* Express middleware to use for every Sails request. To add custom *
|
17
|
-
* middleware to the mix, add a function to the middleware config object and *
|
18
|
-
* add its key to the "order" array. The $custom key is reserved for *
|
19
|
-
* backwards-compatibility with Sails v0.9.x apps that use the *
|
20
|
-
* `customMiddleware` config option. *
|
21
|
-
* *
|
22
|
-
****************************************************************************/
|
23
|
-
|
24
|
-
middleware: {
|
25
|
-
|
26
|
-
/***************************************************************************
|
27
|
-
* *
|
28
|
-
* The order in which middleware should be run for HTTP request. (the Sails *
|
29
|
-
* router is invoked by the "router" middleware below.) *
|
30
|
-
* *
|
31
|
-
***************************************************************************/
|
32
|
-
|
33
|
-
// order: [
|
34
|
-
// 'startRequestTimer',
|
35
|
-
// 'cookieParser',
|
36
|
-
// 'session',
|
37
|
-
// 'myRequestLogger',
|
38
|
-
// 'bodyParser',
|
39
|
-
// 'handleBodyParserError',
|
40
|
-
// 'compress',
|
41
|
-
// 'methodOverride',
|
42
|
-
// 'poweredBy',
|
43
|
-
// '$custom',
|
44
|
-
// 'router',
|
45
|
-
// 'www',
|
46
|
-
// 'favicon',
|
47
|
-
// '404',
|
48
|
-
// '500'
|
49
|
-
// ],
|
50
|
-
|
51
|
-
/****************************************************************************
|
52
|
-
* *
|
53
|
-
* Example custom middleware; logs each request to the console. *
|
54
|
-
* *
|
55
|
-
****************************************************************************/
|
56
|
-
|
57
|
-
// myRequestLogger: function (req, res, next) {
|
58
|
-
// console.log("Requested :: ", req.method, req.url);
|
59
|
-
// return next();
|
60
|
-
// }
|
61
|
-
|
62
|
-
|
63
|
-
/***************************************************************************
|
64
|
-
* *
|
65
|
-
* The body parser that will handle incoming multipart HTTP requests. By *
|
66
|
-
* default as of v0.10, Sails uses *
|
67
|
-
* [skipper](http://github.com/balderdashy/skipper). See *
|
68
|
-
* http://www.senchalabs.org/connect/multipart.html for other options. *
|
69
|
-
* *
|
70
|
-
* Note that Sails uses an internal instance of Skipper by default; to *
|
71
|
-
* override it and specify more options, make sure to "npm install skipper" *
|
72
|
-
* in your project first. You can also specify a different body parser or *
|
73
|
-
* a custom function with req, res and next parameters (just like any other *
|
74
|
-
* middleware function). *
|
75
|
-
* *
|
76
|
-
***************************************************************************/
|
77
|
-
|
78
|
-
// bodyParser: require('skipper')({strict: true})
|
79
|
-
|
80
|
-
},
|
81
|
-
|
82
|
-
/***************************************************************************
|
83
|
-
* *
|
84
|
-
* The number of seconds to cache flat files on disk being served by *
|
85
|
-
* Express static middleware (by default, these files are in `.tmp/public`) *
|
86
|
-
* *
|
87
|
-
* The HTTP static cache is only active in a 'production' environment, *
|
88
|
-
* since that's the only time Express will cache flat-files. *
|
89
|
-
* *
|
90
|
-
***************************************************************************/
|
91
|
-
|
92
|
-
// cache: 31557600000
|
93
|
-
};
|
1
|
+
/**
|
2
|
+
* HTTP Server Settings
|
3
|
+
* (sails.config.http)
|
4
|
+
*
|
5
|
+
* Configuration for the underlying HTTP server in Sails.
|
6
|
+
* Only applies to HTTP requests (not WebSockets)
|
7
|
+
*
|
8
|
+
* For more information on configuration, check out:
|
9
|
+
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.http.html
|
10
|
+
*/
|
11
|
+
|
12
|
+
module.exports.http = {
|
13
|
+
|
14
|
+
/****************************************************************************
|
15
|
+
* *
|
16
|
+
* Express middleware to use for every Sails request. To add custom *
|
17
|
+
* middleware to the mix, add a function to the middleware config object and *
|
18
|
+
* add its key to the "order" array. The $custom key is reserved for *
|
19
|
+
* backwards-compatibility with Sails v0.9.x apps that use the *
|
20
|
+
* `customMiddleware` config option. *
|
21
|
+
* *
|
22
|
+
****************************************************************************/
|
23
|
+
|
24
|
+
middleware: {
|
25
|
+
|
26
|
+
/***************************************************************************
|
27
|
+
* *
|
28
|
+
* The order in which middleware should be run for HTTP request. (the Sails *
|
29
|
+
* router is invoked by the "router" middleware below.) *
|
30
|
+
* *
|
31
|
+
***************************************************************************/
|
32
|
+
|
33
|
+
// order: [
|
34
|
+
// 'startRequestTimer',
|
35
|
+
// 'cookieParser',
|
36
|
+
// 'session',
|
37
|
+
// 'myRequestLogger',
|
38
|
+
// 'bodyParser',
|
39
|
+
// 'handleBodyParserError',
|
40
|
+
// 'compress',
|
41
|
+
// 'methodOverride',
|
42
|
+
// 'poweredBy',
|
43
|
+
// '$custom',
|
44
|
+
// 'router',
|
45
|
+
// 'www',
|
46
|
+
// 'favicon',
|
47
|
+
// '404',
|
48
|
+
// '500'
|
49
|
+
// ],
|
50
|
+
|
51
|
+
/****************************************************************************
|
52
|
+
* *
|
53
|
+
* Example custom middleware; logs each request to the console. *
|
54
|
+
* *
|
55
|
+
****************************************************************************/
|
56
|
+
|
57
|
+
// myRequestLogger: function (req, res, next) {
|
58
|
+
// console.log("Requested :: ", req.method, req.url);
|
59
|
+
// return next();
|
60
|
+
// }
|
61
|
+
|
62
|
+
|
63
|
+
/***************************************************************************
|
64
|
+
* *
|
65
|
+
* The body parser that will handle incoming multipart HTTP requests. By *
|
66
|
+
* default as of v0.10, Sails uses *
|
67
|
+
* [skipper](http://github.com/balderdashy/skipper). See *
|
68
|
+
* http://www.senchalabs.org/connect/multipart.html for other options. *
|
69
|
+
* *
|
70
|
+
* Note that Sails uses an internal instance of Skipper by default; to *
|
71
|
+
* override it and specify more options, make sure to "npm install skipper" *
|
72
|
+
* in your project first. You can also specify a different body parser or *
|
73
|
+
* a custom function with req, res and next parameters (just like any other *
|
74
|
+
* middleware function). *
|
75
|
+
* *
|
76
|
+
***************************************************************************/
|
77
|
+
|
78
|
+
// bodyParser: require('skipper')({strict: true})
|
79
|
+
|
80
|
+
},
|
81
|
+
|
82
|
+
/***************************************************************************
|
83
|
+
* *
|
84
|
+
* The number of seconds to cache flat files on disk being served by *
|
85
|
+
* Express static middleware (by default, these files are in `.tmp/public`) *
|
86
|
+
* *
|
87
|
+
* The HTTP static cache is only active in a 'production' environment, *
|
88
|
+
* since that's the only time Express will cache flat-files. *
|
89
|
+
* *
|
90
|
+
***************************************************************************/
|
91
|
+
|
92
|
+
// cache: 31557600000
|
93
|
+
};
|
@@ -1,57 +1,57 @@
|
|
1
|
-
/**
|
2
|
-
* Internationalization / Localization Settings
|
3
|
-
* (sails.config.i18n)
|
4
|
-
*
|
5
|
-
* If your app will touch people from all over the world, i18n (or internationalization)
|
6
|
-
* may be an important part of your international strategy.
|
7
|
-
*
|
8
|
-
*
|
9
|
-
* For more informationom i18n in Sails, check out:
|
10
|
-
* http://sailsjs.org/#!/documentation/concepts/Internationalization
|
11
|
-
*
|
12
|
-
* For a complete list of i18n options, see:
|
13
|
-
* https://github.com/mashpie/i18n-node#list-of-configuration-options
|
14
|
-
*
|
15
|
-
*
|
16
|
-
*/
|
17
|
-
|
18
|
-
module.exports.i18n = {
|
19
|
-
|
20
|
-
/***************************************************************************
|
21
|
-
* *
|
22
|
-
* Which locales are supported? *
|
23
|
-
* *
|
24
|
-
***************************************************************************/
|
25
|
-
|
26
|
-
// locales: ['en', 'es', 'fr', 'de'],
|
27
|
-
|
28
|
-
/****************************************************************************
|
29
|
-
* *
|
30
|
-
* What is the default locale for the site? Note that this setting will be *
|
31
|
-
* overridden for any request that sends an "Accept-Language" header (i.e. *
|
32
|
-
* most browsers), but it's still useful if you need to localize the *
|
33
|
-
* response for requests made by non-browser clients (e.g. cURL). *
|
34
|
-
* *
|
35
|
-
****************************************************************************/
|
36
|
-
|
37
|
-
// defaultLocale: 'en',
|
38
|
-
|
39
|
-
/****************************************************************************
|
40
|
-
* *
|
41
|
-
* Automatically add new keys to locale (translation) files when they are *
|
42
|
-
* encountered during a request? *
|
43
|
-
* *
|
44
|
-
****************************************************************************/
|
45
|
-
|
46
|
-
// updateFiles: false,
|
47
|
-
|
48
|
-
/****************************************************************************
|
49
|
-
* *
|
50
|
-
* Path (relative to app root) of directory to store locale (translation) *
|
51
|
-
* files in. *
|
52
|
-
* *
|
53
|
-
****************************************************************************/
|
54
|
-
|
55
|
-
// localesDirectory: '/config/locales'
|
56
|
-
|
57
|
-
};
|
1
|
+
/**
|
2
|
+
* Internationalization / Localization Settings
|
3
|
+
* (sails.config.i18n)
|
4
|
+
*
|
5
|
+
* If your app will touch people from all over the world, i18n (or internationalization)
|
6
|
+
* may be an important part of your international strategy.
|
7
|
+
*
|
8
|
+
*
|
9
|
+
* For more informationom i18n in Sails, check out:
|
10
|
+
* http://sailsjs.org/#!/documentation/concepts/Internationalization
|
11
|
+
*
|
12
|
+
* For a complete list of i18n options, see:
|
13
|
+
* https://github.com/mashpie/i18n-node#list-of-configuration-options
|
14
|
+
*
|
15
|
+
*
|
16
|
+
*/
|
17
|
+
|
18
|
+
module.exports.i18n = {
|
19
|
+
|
20
|
+
/***************************************************************************
|
21
|
+
* *
|
22
|
+
* Which locales are supported? *
|
23
|
+
* *
|
24
|
+
***************************************************************************/
|
25
|
+
|
26
|
+
// locales: ['en', 'es', 'fr', 'de'],
|
27
|
+
|
28
|
+
/****************************************************************************
|
29
|
+
* *
|
30
|
+
* What is the default locale for the site? Note that this setting will be *
|
31
|
+
* overridden for any request that sends an "Accept-Language" header (i.e. *
|
32
|
+
* most browsers), but it's still useful if you need to localize the *
|
33
|
+
* response for requests made by non-browser clients (e.g. cURL). *
|
34
|
+
* *
|
35
|
+
****************************************************************************/
|
36
|
+
|
37
|
+
// defaultLocale: 'en',
|
38
|
+
|
39
|
+
/****************************************************************************
|
40
|
+
* *
|
41
|
+
* Automatically add new keys to locale (translation) files when they are *
|
42
|
+
* encountered during a request? *
|
43
|
+
* *
|
44
|
+
****************************************************************************/
|
45
|
+
|
46
|
+
// updateFiles: false,
|
47
|
+
|
48
|
+
/****************************************************************************
|
49
|
+
* *
|
50
|
+
* Path (relative to app root) of directory to store locale (translation) *
|
51
|
+
* files in. *
|
52
|
+
* *
|
53
|
+
****************************************************************************/
|
54
|
+
|
55
|
+
// localesDirectory: '/config/locales'
|
56
|
+
|
57
|
+
};
|
@@ -1,29 +1,29 @@
|
|
1
|
-
/**
|
2
|
-
* Built-in Log Configuration
|
3
|
-
* (sails.config.log)
|
4
|
-
*
|
5
|
-
* Configure the log level for your app, as well as the transport
|
6
|
-
* (Underneath the covers, Sails uses Winston for logging, which
|
7
|
-
* allows for some pretty neat custom transports/adapters for log messages)
|
8
|
-
*
|
9
|
-
* For more information on the Sails logger, check out:
|
10
|
-
* http://sailsjs.org/#!/documentation/concepts/Logging
|
11
|
-
*/
|
12
|
-
|
13
|
-
module.exports.log = {
|
14
|
-
|
15
|
-
/***************************************************************************
|
16
|
-
* *
|
17
|
-
* Valid `level` configs: i.e. the minimum log level to capture with *
|
18
|
-
* sails.log.*() *
|
19
|
-
* *
|
20
|
-
* The order of precedence for log levels from lowest to highest is: *
|
21
|
-
* silly, verbose, info, debug, warn, error *
|
22
|
-
* *
|
23
|
-
* You may also set the level to "silent" to suppress all logs. *
|
24
|
-
* *
|
25
|
-
***************************************************************************/
|
26
|
-
|
27
|
-
level: '
|
28
|
-
|
29
|
-
};
|
1
|
+
/**
|
2
|
+
* Built-in Log Configuration
|
3
|
+
* (sails.config.log)
|
4
|
+
*
|
5
|
+
* Configure the log level for your app, as well as the transport
|
6
|
+
* (Underneath the covers, Sails uses Winston for logging, which
|
7
|
+
* allows for some pretty neat custom transports/adapters for log messages)
|
8
|
+
*
|
9
|
+
* For more information on the Sails logger, check out:
|
10
|
+
* http://sailsjs.org/#!/documentation/concepts/Logging
|
11
|
+
*/
|
12
|
+
|
13
|
+
module.exports.log = {
|
14
|
+
|
15
|
+
/***************************************************************************
|
16
|
+
* *
|
17
|
+
* Valid `level` configs: i.e. the minimum log level to capture with *
|
18
|
+
* sails.log.*() *
|
19
|
+
* *
|
20
|
+
* The order of precedence for log levels from lowest to highest is: *
|
21
|
+
* silly, verbose, info, debug, warn, error *
|
22
|
+
* *
|
23
|
+
* You may also set the level to "silent" to suppress all logs. *
|
24
|
+
* *
|
25
|
+
***************************************************************************/
|
26
|
+
|
27
|
+
level: 'debug'
|
28
|
+
|
29
|
+
};
|
@@ -1,9 +1,9 @@
|
|
1
|
-
module.exports.models = {
|
2
|
-
migrate: 'drop',
|
3
|
-
attributes: {
|
4
|
-
id: { type: 'number', autoIncrement: true, },
|
5
|
-
createdAt: { type: 'number', autoCreatedAt: true, },
|
6
|
-
updatedAt: { type: 'number', autoUpdatedAt: true, }
|
7
|
-
},
|
8
|
-
|
1
|
+
module.exports.models = {
|
2
|
+
migrate: 'drop',
|
3
|
+
attributes: {
|
4
|
+
id: { type: 'number', autoIncrement: true, },
|
5
|
+
createdAt: { type: 'number', autoCreatedAt: true, },
|
6
|
+
updatedAt: { type: 'number', autoUpdatedAt: true, }
|
7
|
+
},
|
8
|
+
|
9
9
|
};
|
@@ -1,22 +1,22 @@
|
|
1
|
-
module.exports.modulemanager = {
|
2
|
-
navbar: [
|
3
|
-
{
|
4
|
-
id: "1",
|
5
|
-
name: "Мои модули",
|
6
|
-
link: `/admin/modules/my`,
|
7
|
-
icon: "home"
|
8
|
-
},
|
9
|
-
{
|
10
|
-
id: "2",
|
11
|
-
name: "Обновления",
|
12
|
-
link: `/admin/modules/updates`,
|
13
|
-
icon: "cloud-download-alt"
|
14
|
-
},
|
15
|
-
{
|
16
|
-
id: "3",
|
17
|
-
name: "Маркетплейс",
|
18
|
-
link: `/admin/modules/market`,
|
19
|
-
icon: "shopping-
|
20
|
-
}
|
21
|
-
]
|
22
|
-
}
|
1
|
+
module.exports.modulemanager = {
|
2
|
+
navbar: [
|
3
|
+
{
|
4
|
+
id: "1",
|
5
|
+
name: "Мои модули",
|
6
|
+
link: `/admin/modules/my`,
|
7
|
+
icon: "home"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
id: "2",
|
11
|
+
name: "Обновления",
|
12
|
+
link: `/admin/modules/updates`,
|
13
|
+
icon: "cloud-download-alt"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
id: "3",
|
17
|
+
name: "Маркетплейс",
|
18
|
+
link: `/admin/modules/market`,
|
19
|
+
icon: "shopping-order"
|
20
|
+
}
|
21
|
+
]
|
22
|
+
}
|
@@ -1,51 +1,51 @@
|
|
1
|
-
/**
|
2
|
-
* Policy Mappings
|
3
|
-
* (sails.config.policies)
|
4
|
-
*
|
5
|
-
* Policies are simple functions which run **before** your controllers.
|
6
|
-
* You can apply one or more policies to a given controller, or protect
|
7
|
-
* its actions individually.
|
8
|
-
*
|
9
|
-
* Any policy file (e.g. `api/policies/authenticated.js`) can be accessed
|
10
|
-
* below by its filename, minus the extension, (e.g. "authenticated")
|
11
|
-
*
|
12
|
-
* For more information on how policies work, see:
|
13
|
-
* http://sailsjs.org/#!/documentation/concepts/Policies
|
14
|
-
*
|
15
|
-
* For more information on configuring policies, check out:
|
16
|
-
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.policies.html
|
17
|
-
*/
|
18
|
-
|
19
|
-
|
20
|
-
module.exports.policies = {
|
21
|
-
|
22
|
-
/***************************************************************************
|
23
|
-
* *
|
24
|
-
* Default policy for all controllers and actions (`true` allows public *
|
25
|
-
* access) *
|
26
|
-
* *
|
27
|
-
***************************************************************************/
|
28
|
-
|
29
|
-
// '*': true,
|
30
|
-
|
31
|
-
/***************************************************************************
|
32
|
-
* *
|
33
|
-
* Here's an example of mapping some policies to run before a controller *
|
34
|
-
* and its actions *
|
35
|
-
* *
|
36
|
-
***************************************************************************/
|
37
|
-
// RabbitController: {
|
38
|
-
|
39
|
-
// Apply the `false` policy as the default for all of RabbitController's actions
|
40
|
-
// (`false` prevents all access, which ensures that nothing bad happens to our rabbits)
|
41
|
-
// '*': false,
|
42
|
-
|
43
|
-
// For the action `nurture`, apply the 'isRabbitMother' policy
|
44
|
-
// (this overrides `false` above)
|
45
|
-
// nurture : 'isRabbitMother',
|
46
|
-
|
47
|
-
// Apply the `isNiceToAnimals` AND `hasRabbitFood` policies
|
48
|
-
// before letting any users feed our rabbits
|
49
|
-
// feed : ['isNiceToAnimals', 'hasRabbitFood']
|
50
|
-
// }
|
51
|
-
};
|
1
|
+
/**
|
2
|
+
* Policy Mappings
|
3
|
+
* (sails.config.policies)
|
4
|
+
*
|
5
|
+
* Policies are simple functions which run **before** your controllers.
|
6
|
+
* You can apply one or more policies to a given controller, or protect
|
7
|
+
* its actions individually.
|
8
|
+
*
|
9
|
+
* Any policy file (e.g. `api/policies/authenticated.js`) can be accessed
|
10
|
+
* below by its filename, minus the extension, (e.g. "authenticated")
|
11
|
+
*
|
12
|
+
* For more information on how policies work, see:
|
13
|
+
* http://sailsjs.org/#!/documentation/concepts/Policies
|
14
|
+
*
|
15
|
+
* For more information on configuring policies, check out:
|
16
|
+
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.policies.html
|
17
|
+
*/
|
18
|
+
|
19
|
+
|
20
|
+
module.exports.policies = {
|
21
|
+
|
22
|
+
/***************************************************************************
|
23
|
+
* *
|
24
|
+
* Default policy for all controllers and actions (`true` allows public *
|
25
|
+
* access) *
|
26
|
+
* *
|
27
|
+
***************************************************************************/
|
28
|
+
|
29
|
+
// '*': true,
|
30
|
+
|
31
|
+
/***************************************************************************
|
32
|
+
* *
|
33
|
+
* Here's an example of mapping some policies to run before a controller *
|
34
|
+
* and its actions *
|
35
|
+
* *
|
36
|
+
***************************************************************************/
|
37
|
+
// RabbitController: {
|
38
|
+
|
39
|
+
// Apply the `false` policy as the default for all of RabbitController's actions
|
40
|
+
// (`false` prevents all access, which ensures that nothing bad happens to our rabbits)
|
41
|
+
// '*': false,
|
42
|
+
|
43
|
+
// For the action `nurture`, apply the 'isRabbitMother' policy
|
44
|
+
// (this overrides `false` above)
|
45
|
+
// nurture : 'isRabbitMother',
|
46
|
+
|
47
|
+
// Apply the `isNiceToAnimals` AND `hasRabbitFood` policies
|
48
|
+
// before letting any users feed our rabbits
|
49
|
+
// feed : ['isNiceToAnimals', 'hasRabbitFood']
|
50
|
+
// }
|
51
|
+
};
|
@@ -1,49 +1,49 @@
|
|
1
|
-
/**
|
2
|
-
* Route Mappings
|
3
|
-
* (sails.config.routes)
|
4
|
-
*
|
5
|
-
* Your routes map URLs to views and controllers.
|
6
|
-
*
|
7
|
-
* If Sails receives a URL that doesn't match any of the routes below,
|
8
|
-
* it will check for matching files (images, scripts, stylesheets, etc.)
|
9
|
-
* in your assets directory. e.g. `http://localhost:1337/images/foo.jpg`
|
10
|
-
* might match an image file: `/assets/images/foo.jpg`
|
11
|
-
*
|
12
|
-
* Finally, if those don't match either, the default 404 handler is triggered.
|
13
|
-
* See `api/responses/notFound.js` to adjust your app's 404 logic.
|
14
|
-
*
|
15
|
-
* Note: Sails doesn't ACTUALLY serve stuff from `assets`-- the default Gruntfile in Sails copies
|
16
|
-
* flat files from `assets` to `.tmp/public`. This allows you to do things like compile LESS or
|
17
|
-
* CoffeeScript for the front-end.
|
18
|
-
*
|
19
|
-
* For more information on configuring custom routes, check out:
|
20
|
-
* http://sailsjs.org/#!/documentation/concepts/Routes/RouteTargetSyntax.html
|
21
|
-
*/
|
22
|
-
|
23
|
-
module.exports.routes = {
|
24
|
-
|
25
|
-
/***************************************************************************
|
26
|
-
* *
|
27
|
-
* Make the view located at `views/homepage.ejs` (or `views/homepage.jade`, *
|
28
|
-
* etc. depending on your default view engine) your home page. *
|
29
|
-
* *
|
30
|
-
* (Alternatively, remove this and add an `index.html` file in your *
|
31
|
-
* `assets` directory) *
|
32
|
-
* *
|
33
|
-
***************************************************************************/
|
34
|
-
|
35
|
-
'/': {
|
36
|
-
view: 'homepage'
|
37
|
-
}
|
38
|
-
|
39
|
-
/***************************************************************************
|
40
|
-
* *
|
41
|
-
* Custom routes here... *
|
42
|
-
* *
|
43
|
-
* If a request to a URL doesn't match any of the custom routes above, it *
|
44
|
-
* is matched against Sails route blueprints. See `config/blueprints.js` *
|
45
|
-
* for configuration options and examples. *
|
46
|
-
* *
|
47
|
-
***************************************************************************/
|
48
|
-
|
49
|
-
};
|
1
|
+
/**
|
2
|
+
* Route Mappings
|
3
|
+
* (sails.config.routes)
|
4
|
+
*
|
5
|
+
* Your routes map URLs to views and controllers.
|
6
|
+
*
|
7
|
+
* If Sails receives a URL that doesn't match any of the routes below,
|
8
|
+
* it will check for matching files (images, scripts, stylesheets, etc.)
|
9
|
+
* in your assets directory. e.g. `http://localhost:1337/images/foo.jpg`
|
10
|
+
* might match an image file: `/assets/images/foo.jpg`
|
11
|
+
*
|
12
|
+
* Finally, if those don't match either, the default 404 handler is triggered.
|
13
|
+
* See `api/responses/notFound.js` to adjust your app's 404 logic.
|
14
|
+
*
|
15
|
+
* Note: Sails doesn't ACTUALLY serve stuff from `assets`-- the default Gruntfile in Sails copies
|
16
|
+
* flat files from `assets` to `.tmp/public`. This allows you to do things like compile LESS or
|
17
|
+
* CoffeeScript for the front-end.
|
18
|
+
*
|
19
|
+
* For more information on configuring custom routes, check out:
|
20
|
+
* http://sailsjs.org/#!/documentation/concepts/Routes/RouteTargetSyntax.html
|
21
|
+
*/
|
22
|
+
|
23
|
+
module.exports.routes = {
|
24
|
+
|
25
|
+
/***************************************************************************
|
26
|
+
* *
|
27
|
+
* Make the view located at `views/homepage.ejs` (or `views/homepage.jade`, *
|
28
|
+
* etc. depending on your default view engine) your home page. *
|
29
|
+
* *
|
30
|
+
* (Alternatively, remove this and add an `index.html` file in your *
|
31
|
+
* `assets` directory) *
|
32
|
+
* *
|
33
|
+
***************************************************************************/
|
34
|
+
|
35
|
+
'/': {
|
36
|
+
view: 'homepage'
|
37
|
+
}
|
38
|
+
|
39
|
+
/***************************************************************************
|
40
|
+
* *
|
41
|
+
* Custom routes here... *
|
42
|
+
* *
|
43
|
+
* If a request to a URL doesn't match any of the custom routes above, it *
|
44
|
+
* is matched against Sails route blueprints. See `config/blueprints.js` *
|
45
|
+
* for configuration options and examples. *
|
46
|
+
* *
|
47
|
+
***************************************************************************/
|
48
|
+
|
49
|
+
};
|