-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from codeforbtv/kelly-davis-dev
Kelly davis dev
- Loading branch information
Showing
17 changed files
with
8,737 additions
and
21 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
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
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,34 @@ | ||
# IDE files | ||
.idea | ||
|
||
# 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 | ||
|
||
# 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 | ||
node_modules | ||
|
||
# Users Environment Variables | ||
.lock-wscript | ||
|
||
# Runtime configuration for swagger app | ||
config/runtime.yaml |
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 @@ | ||
# Skeleton project for 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 @@ | ||
Place your controllers in this directory. |
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,45 @@ | ||
'use strict'; | ||
/* | ||
'use strict' is not required but helpful for turning syntactical errors into true errors in the program flow | ||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode | ||
*/ | ||
|
||
/* | ||
Modules make it possible to import JavaScript files into your application. Modules are imported | ||
using 'require' statements that give you a reference to the module. | ||
It is a good idea to list the modules that your application depends on in the package.json in the project root | ||
*/ | ||
var util = require('util'); | ||
|
||
/* | ||
Once you 'require' a module you can reference the things that it exports. These are defined in module.exports. | ||
For a controller in a127 (which this is) you should export the functions referenced in your Swagger document by name. | ||
Either: | ||
- The HTTP Verb of the corresponding operation (get, put, post, delete, etc) | ||
- Or the operationId associated with the operation in your Swagger document | ||
In the starter/skeleton project the 'get' operation on the '/hello' path has an operationId named 'hello'. Here, | ||
we specify that in the exports of this module that 'hello' maps to the function named 'hello' | ||
*/ | ||
module.exports = { | ||
hello: hello | ||
}; | ||
|
||
/* | ||
Functions in a127 controllers used for operations should take two parameters: | ||
Param 1: a handle to the request object | ||
Param 2: a handle to the response object | ||
*/ | ||
function hello(req, res) { | ||
// variables defined in the Swagger document can be referenced using req.swagger.params.{parameter_name} | ||
var name = req.swagger.params.name.value || 'stranger'; | ||
console.log('res', res) | ||
var hello = util.format('Hello, %s!', name); | ||
|
||
// this sends back a JSON response which is a single string | ||
res.json(hello); | ||
} |
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 @@ | ||
Place helper files in this directory. |
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 @@ | ||
Place controllers for mock mode in this directory. |
Oops, something went wrong.