Jieun Chung

add NodeJS

......@@ -11,6 +11,10 @@ EPL 통계 사이트
---
## 설치 방법
1. git clone http://khuhub.khu.ac.kr/2018102163/OSS_PROJECT.git
2. npm install
## 빌드 방법
......@@ -19,4 +23,5 @@ EPL 통계 사이트
## 사용 방법
## LICENSE
\ No newline at end of file
## LICENSE
MIT LICENSE
\ No newline at end of file
......
This diff is collapsed. Click to expand it.
{
"name": "nodejs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.17.1",
"request": "^2.88.2"
}
}
const request = require('request');
var express = require('express')
var app = express()
const options = {
method: 'GET',
url: 'https://api-football-v1.p.rapidapi.com/v2/players/player/253/2018-2019',
headers: {
'x-rapidapi-key': '9ed13b26e4mshede3aa7b615039ep17f6e6jsn308dd6295276',
'x-rapidapi-host': 'api-football-v1.p.rapidapi.com',
useQueryString: true
}
};
app.get('/', function(req, res){
request(options, function (error, response, body) {
if (error) throw new Error(error);
res.send(body);
console.log(response);
});
})
var server = app.listen(23023, function(){
var host = server.address().address
var port = server.address().port;
console.log('App listening at http://%s:%s', host, port)
})