Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

swagger #516

Open
wants to merge 409 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
409 commits
Select commit Hold shift + click to select a range
3dddc72
little bit more meat to readme
prabhatjha Jun 8, 2015
2cef234
Merge pull request #213 from swagger-api/apache-license
prabhatjha Jun 8, 2015
158ee19
Merge pull request #212 from prabhatjha/readme_update
theganyo Jun 8, 2015
5c84592
revision
WWitman Jun 9, 2015
48ca26e
work on readme
WWitman Jun 9, 2015
3e6eed1
work on readme
WWitman Jun 9, 2015
fff3736
work on readme
WWitman Jun 9, 2015
80bf1f8
work on readme
WWitman Jun 9, 2015
63866f1
work on readme
WWitman Jun 9, 2015
52b585d
readme revisions
WWitman Jun 9, 2015
23b7c1d
readme revisions
WWitman Jun 9, 2015
248b234
readme revisions
WWitman Jun 9, 2015
ae1c54d
readme revisions
WWitman Jun 9, 2015
bc6d25e
readme revisions
WWitman Jun 9, 2015
e0df99e
readme revisions
WWitman Jun 9, 2015
5d6390d
readme revisions
WWitman Jun 9, 2015
8459e6e
readme revisions
WWitman Jun 9, 2015
ba2813a
readme revisions
WWitman Jun 9, 2015
eb74e26
readme revisions
WWitman Jun 9, 2015
4459be6
readme revisions
WWitman Jun 9, 2015
5b34870
readme revisions
WWitman Jun 9, 2015
6b40f75
readme revisions
WWitman Jun 9, 2015
31cafe7
readme revisions
WWitman Jun 9, 2015
4ece87c
readme revisions
WWitman Jun 9, 2015
e5f552a
readme revisions
WWitman Jun 9, 2015
caea953
readme revisions
WWitman Jun 9, 2015
1f3d955
readme revisions
WWitman Jun 9, 2015
24acd9d
readme revision
WWitman Jun 9, 2015
39127a2
readme revision
WWitman Jun 9, 2015
74141ca
readme revision
WWitman Jun 9, 2015
3fb7560
readme revision
WWitman Jun 9, 2015
fae7be6
readme revision
WWitman Jun 9, 2015
6d82f6e
readme revision
WWitman Jun 9, 2015
2f4df01
readme revision
WWitman Jun 9, 2015
988a786
readme revision
WWitman Jun 11, 2015
a9b826e
new file
WWitman Jun 11, 2015
26e0e59
added picture
WWitman Jun 11, 2015
1367661
new image
WWitman Jun 11, 2015
897720d
added picture
WWitman Jun 11, 2015
484802a
new image
WWitman Jun 11, 2015
a6c7fd5
new image
WWitman Jun 11, 2015
ee67e3e
new image
WWitman Jun 11, 2015
a5e2db5
new image
WWitman Jun 11, 2015
914b2cf
edit
WWitman Jun 11, 2015
a872e5a
edit
WWitman Jun 11, 2015
03e4673
edit
WWitman Jun 11, 2015
9fd545e
Support custom host and port for editor
joostfarla Jun 11, 2015
1ad3c62
Merge pull request #219 from joostfarla/vagrant
theganyo Jun 11, 2015
ce4d265
iter
WWitman Jun 11, 2015
e897384
iter
WWitman Jun 11, 2015
31fcb3c
Merge pull request #215 from WWitman/master
theganyo Jun 11, 2015
e2fe50d
0.6.0
theganyo Jun 12, 2015
11e40e9
Typo
ponelat Jun 15, 2015
538d3a6
Merge pull request #221 from ponelat/patch-1
theganyo Jun 15, 2015
2539c3c
Fixed outdated links
Jun 23, 2015
0fe0e31
Fix broken links in README.
theopak Jun 23, 2015
84c522a
Translate images to code within markdown tags.
theopak Jun 23, 2015
3a12052
Merge pull request #225 from davidmach14/master
theganyo Jun 23, 2015
669207f
Translate images to code within markdown tags.
theopak Jun 23, 2015
adc6682
Merge pull request #226 from theopak/master
theganyo Jun 23, 2015
4d8e525
Typo
davidmach14 Jun 24, 2015
3e22b1c
Fixed link to Swagger 2.0 specification
davidmach14 Jun 24, 2015
6a6f633
Fixed link to Swagger 2.0 specification
davidmach14 Jun 24, 2015
0a47639
Fixed link to Swagger 2.0 specification
davidmach14 Jun 24, 2015
a30b457
Fixed error in example
davidmach14 Jun 24, 2015
2704e7f
Merge pull request #227 from davidmach14/master
theganyo Jun 24, 2015
fd49401
Run all tests instead of a single test group
bvleur Jul 1, 2015
6178c24
Fix --debug and --debug-brk options
bvleur Jul 1, 2015
bce85e8
Merge pull request #241 from bvleur/run-all-tests
theganyo Jul 1, 2015
04dd434
Allow passing extra arguments to node with project start command
bvleur Jul 1, 2015
b76d80d
Merge pull request #242 from bvleur/fix-project-start-cli-debug-options
theganyo Jul 1, 2015
0e36cb1
Fix broken link in README.md
carnesen Jul 3, 2015
e4eb0dc
Merge pull request #244 from carnesen/patch-1
theganyo Jul 6, 2015
ce640b0
Make it easier to deploy to platforms like Heroku
earth2marsh Jul 6, 2015
f024322
Merge pull request #246 from earth2marsh/patch-1
theganyo Jul 6, 2015
7463efa
Fixes #253
Jul 14, 2015
fcd4ab2
Merge pull request #254 from robotrobot/swagger-tools-0-9-0
theganyo Jul 14, 2015
831adf2
enable mock mode when specified for 'project test'. fixes #52
theganyo Jul 14, 2015
d94ecbe
increase timeout for project test
theganyo Jul 14, 2015
62345e6
Merge pull request #238 from bvleur/extra-node-args
theganyo Jul 14, 2015
abf82ae
Add `swagger project generate-test` command
mohsen1 Jul 15, 2015
4501d89
Hanle override files case
mohsen1 Jul 16, 2015
f10b3ac
fix overlook writing of new files
Jul 16, 2015
27e66eb
fix and add tests to handle user input for overwrites
Jul 16, 2015
c155707
add mock-stdin as dev dependency
Jul 16, 2015
4736f7e
add better testing of the overwrite all option
Jul 16, 2015
49c8af2
add js-yaml devDependency
Jul 16, 2015
4a956d8
add dotenv dependency injection
Jul 17, 2015
e68bb7f
Merge pull request #10 from apigee-127/dot-env
mohsen1 Jul 17, 2015
f3cc915
Merge pull request #8 from apigee-127/override-files
mohsen1 Jul 17, 2015
560731d
fix env file to be witten in root directory
Jul 20, 2015
e758d4a
fixed the bug -o does not work
Jul 20, 2015
0d64dfc
Merge pull request #12 from apigee-127/force-bug
mohsen1 Jul 20, 2015
ba0cb33
Merge pull request #11 from apigee-127/env-location
mohsen1 Jul 20, 2015
f0b2dee
fix naming convention on constants
Jul 22, 2015
476eb45
add error handling in dependency injection
Jul 22, 2015
26d0743
remove redundant inject code
Jul 22, 2015
585beaa
fix using lodash correctly
Jul 22, 2015
06ffb79
Merge pull request #13 from apigee-127/injection-redundancy
mohsen1 Jul 22, 2015
dd30414
add overwrite this and following
Jul 22, 2015
5f96830
Merge pull request #14 from apigee-127/none-all-option
mohsen1 Jul 22, 2015
43dfdc3
fix lodash use
Jul 23, 2015
f94488b
Merge pull request #15 from apigee-127/lodash-fix
mohsen1 Jul 23, 2015
a2fa6d9
fixed typos, wording and redundant modules
Jul 24, 2015
bbf87a4
Merge pull request #16 from apigee-127/wording-fixes
mohsen1 Jul 24, 2015
ee45066
change file write path to write tests in tests/api/client directory
Jul 24, 2015
20ad95e
change test script injection reflects file hierarchy
Jul 24, 2015
37900df
Merge pull request #17 from apigee-127/file-writing
mohsen1 Jul 24, 2015
a7b4aa2
fix injects swagger test command
Jul 24, 2015
e485261
fix to use configured swagger fileName
theganyo Jul 24, 2015
f00ad53
Merge pull request #18 from apigee-127/test-script-injection
mohsen1 Jul 24, 2015
98c38e9
Merge pull request #251 from apigee-127/master
theganyo Jul 27, 2015
3ccc7f6
Update swagger-test-templates dependency to 1.1
mohsen1 Jul 27, 2015
3870d60
Merge pull request #260 from apigee-127/update-swagger-test-templates
theganyo Jul 27, 2015
d5d5f84
0.6.1
theganyo Jul 27, 2015
5d6d634
0.6.2
theganyo Jul 27, 2015
4001fdb
fix path to check for conflict files
Jul 28, 2015
ff83230
Merge pull request #261 from apigee-127/overwrite-fix
theganyo Jul 28, 2015
089a09d
fix tests and conflict verification path
Jul 28, 2015
f3d3055
Merge pull request #262 from apigee-127/overwrite-fix-2
theganyo Jul 28, 2015
9ebbf48
0.6.3
theganyo Jul 28, 2015
f2d88ab
add dependencies for converter
Jul 30, 2015
6759d8d
add swagger convert command
Jul 30, 2015
5f934cc
change move swagger command code out of cli file and into individual …
Jul 30, 2015
1245b47
Tests are functional
Jul 31, 2015
a11f64e
Code refactored and passes tests
Jul 31, 2015
edef974
change dependency mocking all through proxyquire
Aug 3, 2015
8edac56
Merge pull request #264 from apigee-127/converter-command
theganyo Aug 3, 2015
2d60d8c
Update swagger-file.md
Aug 4, 2015
44b9b6d
Merge pull request #267 from yurykozyrev/patch-1
theganyo Aug 4, 2015
ff4707b
add cli option stub
Aug 13, 2015
56d6493
add load-testing API functionality
Aug 17, 2015
fd4e65d
add load-test option test and bump test-templates version
Aug 18, 2015
3000dd0
Removing execute permissions from project-skeleton files.
jsdevel Aug 18, 2015
94be2ae
Merge pull request #279 from jsdevel/removing-execute-perms
theganyo Aug 19, 2015
0bcab42
Closes #269: Do not show try this when project does not have /hello p…
jsdevel Aug 19, 2015
fac9037
Merge pull request #280 from jsdevel/avoid-printing-hello-when-it-doe…
theganyo Aug 19, 2015
7e8fc6e
change config search path logic
Aug 20, 2015
690ed20
add test for specified load test config
Aug 20, 2015
341753a
change modularize parsing json files
Aug 20, 2015
edfae43
change load test error message
Aug 20, 2015
28baf06
Allow multiple extra node arguments to be passed
bvleur Aug 24, 2015
f0c7e5d
Merge pull request #274 from apigee-127/load-test-cli
theganyo Aug 24, 2015
aabc61c
Merge pull request #285 from bvleur/extra-node-args-multiple
theganyo Aug 24, 2015
97c14a6
bagpipes-based projects, tests consolidation
theganyo Sep 11, 2015
d4a4989
validateResponse typo in config templates
theganyo Sep 11, 2015
6f92da9
0.7.1
theganyo Sep 11, 2015
6dba74b
remove legacy swagger_loader pipe
theganyo Sep 11, 2015
e9c552c
configuration documentation for beta
theganyo Sep 11, 2015
cc9ceff
0.7.2
theganyo Sep 11, 2015
df25c28
update deps
theganyo Sep 11, 2015
2bb4efc
fix tests to work with new templates
theganyo Sep 11, 2015
c85a333
update all template deps to latest revs
theganyo Sep 11, 2015
107c781
0.7.3
theganyo Sep 11, 2015
cc6ceb6
hopefully fix travis timeout
theganyo Sep 11, 2015
eee0bb5
Add default start and test scripts to package.json templates
theganyo Sep 17, 2015
f437ddc
travis: add "latest", remove io.js
theganyo Sep 17, 2015
52e03a3
travis: "latest" s/b "stable"
theganyo Sep 17, 2015
ba7d964
Better reference for 'use strict'; in connect controller.
darkyen Sep 28, 2015
07977e5
Updated to better reference for sails
darkyen Sep 28, 2015
7e8fbaa
update to latest deps
theganyo Oct 1, 2015
802fc77
doc updates
theganyo Oct 5, 2015
e6cd406
doc updates
theganyo Oct 5, 2015
2a07fdc
doc updates
theganyo Oct 5, 2015
6b3f07d
Merge pull request #300 from swagger-api/bagpipes
theganyo Oct 5, 2015
08e9db5
Merge pull request #298 from darkyen/patch-1
theganyo Oct 7, 2015
64408dc
remove env set from test templates
theganyo Oct 7, 2015
d06effe
clean up nodemon error message on quit
theganyo Oct 9, 2015
06da235
0.7.4
theganyo Oct 9, 2015
b097f62
remove node_modules from fittings load directory
theganyo Oct 12, 2015
9135620
0.7.5
theganyo Oct 12, 2015
e8ad7a3
Missing quotes in $ref value
dmitry-zaets Nov 5, 2015
4e906a8
Make a note about the change between options
ccasbre27 Dec 8, 2015
982774a
Merge pull request #328 from ccasbre27/patch-1
fehguy Dec 8, 2015
4020e6f
Swagger Spec -> OpenAPI Spec
webron Dec 30, 2015
bc7150f
Happy new year!
webron Jan 7, 2016
62caf6d
Update README.md
webron Feb 12, 2016
3a000dc
fixed per #348
fehguy Feb 16, 2016
26470f7
Fixes the broken build
webron Mar 29, 2016
f055146
Merge pull request #363 from swagger-api/build_fix
webron Mar 29, 2016
057ca0b
Merge pull request #319 from dmitry-zaets/patch-1
webron Mar 30, 2016
103b833
npm@3 support: fix swagger-editor dir path
at15 Apr 20, 2016
172e1c7
Merge pull request #369 from at15/master
fehguy Apr 20, 2016
c60c32c
Add documentation about running in deployment
aroach Jul 28, 2016
8e53f8c
Merge pull request #415 from aroach/master
fehguy Jul 28, 2016
e910526
silly commit for testing CI
itai421 Nov 7, 2016
4932841
Revert "npm@3 support: fix swagger-editor dir path"
itai421 Nov 7, 2016
79a42ef
Merge pull request #453 from itai421/build-fix
fehguy Nov 7, 2016
aef95fc
Fixed single quote.
rmariuzzo Nov 25, 2016
60eb0ab
Merge pull request #459 from rmariuzzo/patch-1
fehguy Nov 28, 2016
cb14348
Replaced callback by process.exit to comply with ci tools
Haves1001 Dec 8, 2016
0cb1f34
Increased timeout to avoid error in travis
Haves1001 Dec 8, 2016
b61120f
Corrected wrong approach as timeout can not be higher than 2000ms
Haves1001 Dec 8, 2016
d9b5eff
Replaced nextTick by setTimeout to get travis build green
Haves1001 Dec 8, 2016
0b00202
added 250ms timeout to setTimeout
Haves1001 Dec 8, 2016
41dd2d4
Upgraded inquirer version vfrom 0.10.0 to 2.0.0 as travis error might…
Haves1001 Dec 8, 2016
0fd99c5
added done callback to tests to avoid a timeout
Haves1001 Dec 8, 2016
70545b0
Downgraded inquirer.js to v1.2.3 as v2.0.0 does not support node 0.1.2
Haves1001 Dec 8, 2016
fffa399
Merge pull request #463 from henningvs/master
fehguy Dec 8, 2016
7bdfbe1
added bages similar to #310
Haves1001 Dec 8, 2016
b6d0d41
Merge pull request #464 from henningvs/master
fehguy Dec 8, 2016
8ffc97d
updated async version in dependencies
Haves1001 Dec 8, 2016
a26d48a
updated fs-extra version in dependencies
Haves1001 Dec 8, 2016
6fb7832
updated lodash version in dependencies
Haves1001 Dec 8, 2016
4931cdb
updated mocha version in dependencies
Haves1001 Dec 8, 2016
1a1e365
updated swagger-converter version in dependencies
Haves1001 Dec 8, 2016
6cfa211
updated swagger-tools version in dependencies
Haves1001 Dec 8, 2016
50565ea
updated should version in dependencies
Haves1001 Dec 8, 2016
4045434
updated superagent version in dependencies
Haves1001 Dec 8, 2016
5ab1756
updated superagent + supertest version in dependencies
Haves1001 Dec 8, 2016
b9bc118
updated tmp version in dependencies
Haves1001 Dec 8, 2016
93f6fae
replaced contains by includes to get lodash running
Haves1001 Dec 8, 2016
f0cd879
Merge commit '4931cdb250bddcc6a3e33fb3a5586ab3687118c1' into lodash-fix
Haves1001 Dec 8, 2016
516938c
Merge commit '1a1e36574aeb9f75618aad5c8b8b9b1b4354bd2f' into lodash-fix
Haves1001 Dec 8, 2016
1fd2555
Merge commit '6cfa211a08b036b27ab43b28cdeada25a17590d9' into lodash-fix
Haves1001 Dec 8, 2016
4012919
Merge commit '50565ea4e833ec70db200bbe30234f3850d749e8' into lodash-fix
Haves1001 Dec 8, 2016
eb5a349
Merge commit '5ab17563a36403ad6ecec876eca99171df111de6' into lodash-fix
Haves1001 Dec 8, 2016
8630c7e
Merge branch 'lodash-fix' into dependency-update
Haves1001 Dec 8, 2016
a5c33c1
Merge pull request #465 from henningvs/dependency-update
fehguy Jan 5, 2017
b8ef38b
"Hello World"-example should now match its spec
meisterlampe Feb 19, 2017
e600fd7
Fixed response
meisterlampe Feb 20, 2017
d4500e1
Update README.md
meisterlampe Feb 20, 2017
69db9b9
Update controllers.md
meisterlampe Feb 20, 2017
b24ccc5
Update quick-start.md
meisterlampe Feb 20, 2017
7593575
Update hello_world.js
meisterlampe Feb 20, 2017
b561461
Fixed Test for connect framework
meisterlampe Feb 20, 2017
eb458d5
Fixed test for sails framework
meisterlampe Feb 20, 2017
b3ad4ba
Fixed Test
meisterlampe Feb 20, 2017
93f6e0f
Fixed test
meisterlampe Feb 20, 2017
1f01f6a
Merge pull request #475 from meisterlampe/master
fehguy Feb 22, 2017
dc3cd7f
Fix some headers in docs
mrowa44 Mar 16, 2017
93c3dcd
Merge pull request #479 from mrowa44/docs-fix
fehguy Mar 16, 2017
9ba5a26
fixed small typo
Mar 17, 2017
466c300
Merge pull request #483 from smokymcbear/master
fehguy Mar 19, 2017
70846a6
update all connect based frameworks to latest versions
Apr 5, 2017
facfaf3
fix typo
Apr 11, 2017
8bc44f5
update sails skeleton to sails 0.12.13 and swagger-sails-hook 0.7.0
Apr 15, 2017
e2d491d
fix tests - there was a race condition with connect based tests & rev…
Apr 15, 2017
9751554
update Travis tests to Node 4.x
Apr 18, 2017
5bb2539
Merge pull request #489 from micmro/master
fehguy Apr 25, 2017
f429764
misc tweaks to the docs
Apr 17, 2017
c62843c
Merge pull request #493 from micmro/update-docs
fehguy Apr 25, 2017
661928f
fix mock mode example
hrldcpr Jul 20, 2017
b2c7183
Update cli.md
natejenson Oct 10, 2017
3c1e669
Merge pull request #525 from natejenson/patch-1
webron Oct 11, 2017
2ac49a8
update sails `ejs` version
shockey May 8, 2018
2c7dfcb
Merge pull request #559 from swagger-api/ejs-version
shockey May 8, 2018
c13156b
Merge pull request #511 from hrldcpr/patch-1
webron Aug 23, 2018
987b27d
Update LICENSE
webron Jan 9, 2020
fc777a6
update README with archive notice
ponelat Sep 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update sails skeleton to sails 0.12.13 and swagger-sails-hook 0.7.0
Michael Mrowetz committed Apr 15, 2017
commit 8bc44f5629ad5e85a2d9474465950343a6030d3e
10 changes: 10 additions & 0 deletions project-skeletons/sails/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
134 changes: 110 additions & 24 deletions project-skeletons/sails/.gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,120 @@
# IDE files
.idea
################################################
############### .gitignore ##################
################################################
#
# This file is only relevant if you are using git.
#
# Files which match the splat patterns below will
# be ignored by git. This keeps random crap and
# sensitive credentials from being uploaded to
# your repository. It allows you to configure your
# app for your machine without accidentally
# committing settings which will smash the local
# settings of other developers on your team.
#
# Some reasonable defaults are included below,
# but, of course, you should modify/extend/prune
# to fit your needs!
################################################

# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
################################################
# Local Configuration
#
# Explicitly ignore files which contain:
#
# 1. Sensitive information you'd rather not push to
# your git repository.
# e.g., your personal API keys or passwords.
#
# 2. Environment-specific configuration
# Basically, anything that would be annoying
# to have to change every time you do a
# `git pull`
# e.g., your local development database, or
# the S3 bucket you're using for file uploads
# development.
#
################################################

config/local.js


# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git

################################################
# Dependencies
#
# When releasing a production app, you may
# consider including your node_modules and
# bower_components directory in your git repo,
# but during development, its best to exclude it,
# since different developers may be working on
# different kernels, where dependencies would
# need to be recompiled anyway.
#
# More on that here about node_modules dir:
# http://www.futurealoof.com/posts/nodemodules-in-git.html
# (credit Mikeal Rogers, @mikeal)
#
# About bower_components dir, you can see this:
# http://addyosmani.com/blog/checking-in-front-end-dependencies/
# (credit Addy Osmani, @addyosmani)
#
################################################

node_modules
bower_components




################################################
# Sails.js / Waterline / Grunt
#
# Files generated by Sails and Grunt, or related
# tasks and adapters.
################################################
.tmp
dump.rdb


# Users Environment Variables
.lock-wscript

# Runtime configuration for swagger app
config/runtime.yaml


################################################
# Node.js / NPM
#
# Common files generated by Node, NPM, and the
# related ecosystem.
################################################
lib-cov
*.seed
*.log
*.out
*.pid
npm-debug.log





################################################
# Miscellaneous
#
# Common files generated by text editors,
# operating systems, file systems, etc.
################################################

*~
*#
.DS_STORE
.netbeans
nbproject
.idea
.node_history
.vscode
.DS_STORE
5 changes: 5 additions & 0 deletions project-skeletons/sails/.sailsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"generators": {
"modules": {}
}
}
107 changes: 54 additions & 53 deletions project-skeletons/sails/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -15,67 +15,68 @@
module.exports = function(grunt) {


// Load the include-all library in order to require all of our grunt
// configurations and task registrations dynamically.
var includeAll;
try {
includeAll = require('include-all');
} catch (e0) {
try {
includeAll = require('sails/node_modules/include-all');
}
catch(e1) {
console.error('Could not find `include-all` module.');
console.error('Skipping grunt tasks...');
console.error('To fix this, please run:');
console.error('npm install include-all --save`');
console.error();
// Load the include-all library in order to require all of our grunt
// configurations and task registrations dynamically.
var includeAll;
try {
includeAll = require('include-all');
} catch (e0) {
try {
includeAll = require('sails/node_modules/include-all');
} catch (e1) {
console.error('Could not find `include-all` module.');
console.error('Skipping grunt tasks...');
console.error('To fix this, please run:');
console.error('npm install include-all --save`');
console.error();

grunt.registerTask('default', []);
return;
}
}
grunt.registerTask('default', []);
return;
}
}


/**
* Loads Grunt configuration modules from the specified
* relative path. These modules should export a function
* that, when run, should either load/configure or register
* a Grunt task.
*/
function loadTasks(relPath) {
return includeAll({
dirname: require('path').resolve(__dirname, relPath),
filter: /(.+)\.js$/
}) || {};
}
/**
* Loads Grunt configuration modules from the specified
* relative path. These modules should export a function
* that, when run, should either load/configure or register
* a Grunt task.
*/
function loadTasks(relPath) {
return includeAll({
dirname: require('path').resolve(__dirname, relPath),
filter: /(.+)\.js$/,
excludeDirs: /^\.(git|svn)$/
}) || {};
}

/**
* Invokes the function from a Grunt configuration module with
* a single argument - the `grunt` object.
*/
function invokeConfigFn(tasks) {
for (var taskName in tasks) {
if (tasks.hasOwnProperty(taskName)) {
tasks[taskName](grunt);
}
}
}
/**
* Invokes the function from a Grunt configuration module with
* a single argument - the `grunt` object.
*/
function invokeConfigFn(tasks) {
for (var taskName in tasks) {
if (tasks.hasOwnProperty(taskName)) {
tasks[taskName](grunt);
}
}
}



// Load task functions
var taskConfigurations = loadTasks('./tasks/config'),
registerDefinitions = loadTasks('./tasks/register');

// Load task functions
var taskConfigurations = loadTasks('./tasks/config'),
registerDefinitions = loadTasks('./tasks/register');
// (ensure that a default task exists)
if (!registerDefinitions.default) {
registerDefinitions.default = function(grunt) {
grunt.registerTask('default', []);
};
}

// (ensure that a default task exists)
if (!registerDefinitions.default) {
registerDefinitions.default = function (grunt) { grunt.registerTask('default', []); };
}

// Run task functions to configure Grunt.
invokeConfigFn(taskConfigurations);
invokeConfigFn(registerDefinitions);
// Run task functions to configure Grunt.
invokeConfigFn(taskConfigurations);
invokeConfigFn(registerDefinitions);

};
2 changes: 1 addition & 1 deletion project-skeletons/sails/api/policies/sessionAuth.js
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
* @module :: Policy
* @description :: Simple policy to allow any authenticated user
* Assumes that your login action in one of your controllers sets `req.session.authenticated = true;`
* @docs :: http://sailsjs.org/#!documentation/policies
* @docs :: http://sailsjs.org/#!/documentation/concepts/Policies
*
*/
module.exports = function(req, res, next) {
20 changes: 16 additions & 4 deletions project-skeletons/sails/api/responses/badRequest.js
Original file line number Diff line number Diff line change
@@ -34,29 +34,41 @@ module.exports = function badRequest(data, options) {
// Only include errors in response if application environment
// is not set to 'production'. In production, we shouldn't
// send back any identifying information about errors.
if (sails.config.environment === 'production') {
if (sails.config.environment === 'production' && sails.config.keepResponseErrors !== true) {
data = undefined;
}

// If the user-agent wants JSON, always respond with JSON
if (req.wantsJSON) {
// If views are disabled, revert to json
if (req.wantsJSON || sails.config.hooks.views === false) {
return res.jsonx(data);
}

// If second argument is a string, we take that to mean it refers to a view.
// If it was omitted, use an empty object (`{}`)
options = (typeof options === 'string') ? { view: options } : options || {};

// Attempt to prettify data for views, if it's a non-error object
var viewData = data;
if (!(viewData instanceof Error) && 'object' == typeof viewData) {
try {
viewData = require('util').inspect(data, {depth: null});
}
catch(e) {
viewData = undefined;
}
}

// If a view was provided in options, serve it.
// Otherwise try to guess an appropriate view, or if that doesn't
// work, just send JSON.
if (options.view) {
return res.view(options.view, { data: data });
return res.view(options.view, { data: viewData, title: 'Bad Request' });
}

// If no second argument provided, try to serve the implied view,
// but fall back to sending JSON(P) if no view can be inferred.
else return res.guessView({ data: data }, function couldNotGuessView () {
else return res.guessView({ data: viewData, title: 'Bad Request' }, function couldNotGuessView () {
return res.jsonx(data);
});

Loading