forked from jbader14/CIS5500-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
42 lines (35 loc) · 1.32 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const express = require('express');
const cors = require('cors');
const config = require('./config');
const routes = require('./routes');
const app = express();
app.use(cors({
origin: '*',
}));
// We use express to define our various API endpoints and
// provide their handlers that we implemented in routes.js
// API Endpoints
// Route 1
app.get('/avg_passing_yds_weather/:season', routes.avg_passing_yds_weather);
// Route 2
app.get('/top_players/:num', routes.top_players);
// Route 3
app.get('/adverse_weather_performance/:wind_speed/:limit', routes.adverse_weather_performance);
// Route 4
app.get('/adverse_weather_team_comp/:teams', routes.adverse_weather_team_comp);
// Route 5
app.get('/cold_weather_qbs/:min_games', routes.cold_weather_qbs);
// Route 6
app.get('/goal_line_backs/:min_tds/:min_games', routes.goal_line_backs);
// Route 7
app.get('/consistent_scorers/:position', routes.consistent_scorers);
// Route 8
app.get('/injury_resilience/:position', routes.injury_resilience);
// Route 9
app.get('/player_performance_tiers/:position', routes.player_performance_tier);
// Route 10
app.get('/injury_followup_probability/:windowNumber', routes.injury_followup_probability);
app.listen(config.server_port, () => {
console.log(`Server running at http://${config.server_host}:${config.server_port}/`)
});
module.exports = app;