-
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.
- Loading branch information
meusebio.depaz
committed
Nov 23, 2016
1 parent
7ff4c1b
commit cdfedc4
Showing
5 changed files
with
66 additions
and
3 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
bower_components | ||
node_modules | ||
.DS_Store | ||
.idea | ||
|
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 @@ | ||
module.exports = function (grunt) { | ||
grunt.initConfig({ | ||
apidoc: { | ||
myapp: { | ||
src: 'src/', | ||
dest: 'apidoc/' | ||
} | ||
} | ||
|
||
}) | ||
|
||
grunt.loadNpmTasks('grunt-apidoc') | ||
|
||
grunt.registerTask('build', ['apidoc']) | ||
} |
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 +1,34 @@ | ||
console.log('Hello World') | ||
const express = require('express') | ||
const request = require('request'); | ||
let app = express() | ||
|
||
/** | ||
* @api {get} / proxify get request to google | ||
* @apiName GetUser | ||
* @apiGroup User | ||
* | ||
* | ||
* @apiSuccess {Object} full website | ||
*/ | ||
app.get('/', function (req, res) { | ||
|
||
request('http://www.google.com', (error, response, body) => { | ||
|
||
if (error) { | ||
res.send('KO') | ||
return | ||
} | ||
|
||
res.send(body) | ||
|
||
}) | ||
}) | ||
|
||
app.listen(3000, function () { | ||
console.log(arguments) | ||
console.log(JSON.stringify(arguments)) | ||
console.log('Example app listening on port 3000!') | ||
}) | ||
|
||
console.log('Hello World, i\'ll run before the 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 |
---|---|---|
|
@@ -6,15 +6,22 @@ | |
"private": true, | ||
"scripts": { | ||
"start": "node index.js", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"doc_apidoc": "api-doc src -output /doc", | ||
"doc_grunt": "grunt api-doc", | ||
"custom": "node --version", | ||
"standarize": "standard-format -w", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"standarize": "standard-format -w" | ||
}, | ||
"author": "[email protected]", | ||
"license": "MIT", | ||
"dependencies": { | ||
"express": "^4.14.0", | ||
"request": "^2.79.0" | ||
}, | ||
"devDependencies": { | ||
"grunt": "^1.0.1", | ||
"grunt-apidoc": "^0.11.0", | ||
"grunt-cli": "^1.2.0", | ||
"standard-format": "^2.2.3" | ||
} | ||
} |
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 @@ | ||
var request = require('request'); | ||
request('http://www.google.com', function (error, response, body) { | ||
if (!error && response.statusCode == 200) { | ||
console.log(body) // Show the HTML for the Google homepage. | ||
} | ||
}) | ||
|