-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the start of a sports endpoint
- Loading branch information
Showing
5 changed files
with
169 additions
and
4 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,12 @@ | ||
import { Request, Response } from 'express'; | ||
import * as core from 'express-serve-static-core'; | ||
import PremierLeagueData2022 from "../data/football-premier-league-2022"; | ||
|
||
module.exports = function(app: core.Express){ | ||
|
||
// Get a list of teams in the uk premier football league from 2022 | ||
app.get("/sports/football/leagues/premier/teams", (req: Request, res: Response) => { | ||
res.json(PremierLeagueData2022) | ||
}) | ||
|
||
} |
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,124 @@ | ||
const PremierLeagueData2022 = [ | ||
{ | ||
teamName: "Arsenal", | ||
location: "London (Holloway)", | ||
stadium: "Emirates Stadium", | ||
capacity: "60,704" | ||
}, | ||
{ | ||
teamName: "Aston Villa", | ||
location: "Birmingham", | ||
stadium: "Villa Park", | ||
capacity: "42,657" | ||
}, | ||
{ | ||
teamName: "Bournemouth", | ||
location: "Bournemouth", | ||
stadium: "Dean Court", | ||
capacity: "11,307" | ||
}, | ||
{ | ||
teamName: "Brentford", | ||
location: "London (Brentford)", | ||
stadium: "Gtech Community Stadium ", | ||
capacity: "17,250" | ||
}, | ||
{ | ||
teamName: "Brighton & Hove Albion", | ||
location: "Falmer", | ||
stadium: "Falmer Stadium", | ||
capacity: "31,800" | ||
}, | ||
{ | ||
teamName: "Chelsea", | ||
location: "London (Fulham)", | ||
stadium: "Stamford Bridge", | ||
capacity: "40,343" | ||
}, | ||
{ | ||
teamName: "Crystal Palace", | ||
location: "London (Selhurst)", | ||
stadium: "Selhurst Park", | ||
capacity: "25,486" | ||
}, | ||
{ | ||
teamName: "Everton", | ||
location: "Liverpool (Walton)", | ||
stadium: "Goodison Park", | ||
capacity: "39,414" | ||
}, | ||
{ | ||
teamName: "Fulham", | ||
location: "London (Fulham)", | ||
stadium: "Craven Cottage", | ||
capacity: "22,384" | ||
}, | ||
{ | ||
teamName: "Leeds United", | ||
location: "Leeds", | ||
stadium: "Elland Road", | ||
capacity: "37,608" | ||
}, | ||
{ | ||
teamName: "Leicester City", | ||
location: "Leicester", | ||
stadium: "King Power Stadium", | ||
capacity: "32,262" | ||
}, | ||
{ | ||
teamName: "Liverpool", | ||
location: "Liverpool (Anfield)", | ||
stadium: "Anfield", | ||
capacity: "53,394" | ||
}, | ||
{ | ||
teamName: "Manchester City", | ||
location: "Manchester", | ||
stadium: "City of Manchester Stadium", | ||
capacity: "53,400" | ||
}, | ||
{ | ||
teamName: "Manchester United", | ||
location: "Stretford", | ||
stadium: "Old Trafford", | ||
capacity: "74,310" | ||
}, | ||
{ | ||
teamName: "Newcastle United", | ||
location: "Newcastle upon Tyne", | ||
stadium: "St James' Park", | ||
capacity: "52,305" | ||
}, | ||
{ | ||
teamName: "Nottingham Forest", | ||
location: "West Bridgford", | ||
stadium: "City Ground", | ||
capacity: "30,332" | ||
}, | ||
{ | ||
teamName: "Southampton", | ||
location: "Southampton", | ||
stadium: "St Mary's Stadium", | ||
capacity: "32,384" | ||
}, | ||
{ | ||
teamName: "Tottenham Hotspur", | ||
location: "London (Tottenham)", | ||
stadium: "Tottenham Hotspur Stadium", | ||
capacity: "62,850" | ||
}, | ||
{ | ||
teamName: "West Ham United", | ||
location: "London (Stratford)", | ||
stadium: "London Stadium", | ||
capacity: "62,500" | ||
}, | ||
{ | ||
teamName: "Wolverhampton Wanderers", | ||
location: "Wolverhampton", | ||
stadium: "Molineux Stadium", | ||
capacity: "31,750" | ||
} | ||
] | ||
|
||
export default PremierLeagueData2022; |
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