-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alfred J. Kwak
committed
Feb 12, 2017
1 parent
34c770c
commit bf113a3
Showing
11 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This file contains information which helps Meteor properly upgrade your | ||
# app when you run 'meteor update'. You should check it into version control | ||
# with your project. | ||
|
||
notices-for-0.9.0 | ||
notices-for-0.9.1 | ||
0.9.4-platform-file | ||
notices-for-facebook-graph-api-2 | ||
1.2.0-standard-minifiers-package | ||
1.2.0-meteor-platform-split | ||
1.2.0-cordova-changes | ||
1.2.0-breaking-changes | ||
1.3.0-split-minifiers-package | ||
1.4.0-remove-old-dev-bundle-link | ||
1.4.1-add-shell-server-package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file contains a token that is unique to your project. | ||
# Check it into your repository along with the rest of this directory. | ||
# It can be used for purposes such as: | ||
# - ensuring you don't accidentally deploy one app on top of another | ||
# - providing package authors with aggregated statistics | ||
|
||
118uo1u8wjvlhfrieo5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Meteor packages used by this project, one per line. | ||
# Check this file (and the other files in this directory) into your repository. | ||
# | ||
# 'meteor add' and 'meteor remove' will edit this file for you, | ||
# but you can also edit it by hand. | ||
|
||
ecmascript | ||
ajkwak:restivus | ||
ajkwak:restivus-swagger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
browser | ||
server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
METEOR@1.4.2.6 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "<%= appName %>", | ||
"private": true, | ||
"scripts": { | ||
"start": "meteor run" | ||
}, | ||
"dependencies": { | ||
"babel-runtime": "^6.22.0", | ||
"bcrypt": "^1.0.2", | ||
"meteor-node-stubs": "~0.2.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import {Restivus} from 'meteor/ajkwak:restivus'; | ||
|
||
const Api = new Restivus({ | ||
apiPath: 'api', | ||
version: 'v1', | ||
defaultHeaders: { | ||
'Content-Type': 'application/json' | ||
}, | ||
useDefaultAuth: true, | ||
prettyJson: true, | ||
enableCors: true | ||
}); | ||
|
||
// Add Restivus Swagger configuration | ||
// - meta, tags, params, definitions | ||
Api.swagger = { | ||
meta: { | ||
swagger: '2.0', | ||
info: { | ||
version: '<%= version %>', | ||
title: '<%= title %>' | ||
} | ||
} | ||
}; | ||
|
||
// Generate Swagger to route /api/v1/swagger.json | ||
Api.addSwagger('swagger.json'); | ||
|
||
export default Api; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import {Meteor} from 'meteor/meteor'; | ||
import Api from '/server/api'; | ||
|
||
// Enable user endpoints if authentication is enabled | ||
if (Api._config.useDefaultAuth) { | ||
// Generates: POST on /api/v1/users and GET, DELETE /api/v1/users/:id for | ||
// Meteor.users collection | ||
Api.addCollection(Meteor.users, { | ||
excludedEndpoints: ['getAll', 'put'], | ||
routeOptions: { | ||
authRequired: true | ||
}, | ||
endpoints: { | ||
get: { | ||
swagger: { | ||
description: 'Returns user with given ID.', | ||
responses: { | ||
200: { | ||
description: 'One user.' | ||
} | ||
} | ||
} | ||
}, | ||
post: { | ||
authRequired: false, | ||
swagger: { | ||
description: 'Add user.', | ||
responses: { | ||
200: { | ||
description: 'Return user that was added.' | ||
} | ||
} | ||
} | ||
}, | ||
delete: { | ||
roleRequired: 'admin', | ||
swagger: { | ||
description: 'Delete user.', | ||
responses: { | ||
200: { | ||
description: 'Successful delete.' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
} |