-
Notifications
You must be signed in to change notification settings - Fork 229
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 #3 from chdanielmueller/master
Prepare for version 1.0
- Loading branch information
Showing
7 changed files
with
109 additions
and
86 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 |
---|---|---|
@@ -1,55 +1,47 @@ | ||
'use strict'; | ||
|
||
|
||
// Handler for the Homepage | ||
function rootHandler(req, res) { | ||
res.send('Hello World!'); | ||
} | ||
|
||
|
||
// Handler for Login | ||
function loginHandler(req, res) { | ||
res.json(req.body); | ||
} | ||
|
||
|
||
// Sets up the routes. | ||
module.exports.setup = function(app) { | ||
|
||
|
||
/** | ||
* @swagger | ||
* /: | ||
* get: | ||
* description: Returns Hello World! | ||
* responses: | ||
* 200: | ||
* description: hello world | ||
* @swagger | ||
* /: | ||
* get: | ||
* description: Returns the homepage | ||
* responses: | ||
* 200: | ||
* description: hello world | ||
*/ | ||
app.get('/', rootHandler); | ||
app.get('/', function(req, res) { | ||
res.send('Hello World!'); | ||
}); | ||
|
||
|
||
/** | ||
* @swagger | ||
* /login: | ||
* post: | ||
* description: Login to the application | ||
* produces: | ||
* - application/json | ||
* parameters: | ||
* - name: username | ||
* description: Username to use for login. | ||
* in: formData | ||
* required: true | ||
* type: string | ||
* - name: password | ||
* description: User's password. | ||
* in: formData | ||
* required: true | ||
* type: string | ||
* responses: | ||
* 200: | ||
* description: login | ||
* @swagger | ||
* /login: | ||
* post: | ||
* description: Login to the application | ||
* produces: | ||
* - application/json | ||
* parameters: | ||
* - name: username | ||
* description: Username to use for login. | ||
* in: formData | ||
* required: true | ||
* type: string | ||
* - name: password | ||
* description: User's password. | ||
* in: formData | ||
* required: true | ||
* type: string | ||
* responses: | ||
* 200: | ||
* description: login | ||
*/ | ||
app.post('/login', loginHandler); | ||
app.post('/login', function(req, res) { | ||
res.json(req.body); | ||
}); | ||
}; |
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
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