Web API sencilla para consultar información general sobre algunos videojuegos. Está desarrollada con .Net 6 (utilizando la plantilla minimal), y los datos están almacenados en una base de datos Postgresql.
https://games-api-r4qr.onrender.com
Nombre
Tipo
items
T[]
hasItems
boolean
total
number
page
number
pages
number
/games?id
Tipo de respuesta: Game
/games?page&take
/games?name&page&take
/games/developer/{developerId}?page&take
/games/engine/{engineId}?page&take
/games/platform/{platformId}?page&take
/games/genre/{genreId}?page&take
Tipo de respuesta: DataCollection<Game>
Nombre
Tipo
id
int
page
int
take
int
name
string
developerId
int
engineId
int
platformId
int
genreId
int
Nombre
Tipo
id
int
name
string
publisher
string
web
string
| null
developer
GameDeveloper
engine
GameEngine
genres
string[]
soundtracks
GameSoundtrack[]
reviews
GameReview[]
releases
GameRelease[]
GameDeveloper , GameEngine
Nombre
Tipo
name
string
url
string
Nombre
Tipo
web
string
url
string
Nombre
Tipo
platform
string
date
string
Nombre
Tipo
reviewer
string
score
float
Nombre
Tipo
id
int
page
int
take
int
Nombre
Tipo
id
int
name
string
web
string
| null
games
DeveloperGame[]
Nombre
Tipo
name
string
publisher
string
url
string
Nombre
Tipo
id
int
page
int
take
int
Nombre
Tipo
id
int
name
string
composer
string
web
string
| null
game
SoundtrackGame
Nombre
Tipo
name
string
developer
string
url
string
Nombre
Tipo
id
int
page
int
take
int
Nombre
Tipo
id
int
name
string
languages
string[]
web
string
| null
games
EngineGame[]
Nombre
Tipo
name
string
developer
string
url
string
- Clonar y restaurar los paquetes:
git clone https://github.com/HDMC3/games-api.git
cd games-api
dotnet restore
- Restaurar las herramientas:
dotnet tool restore
- Agregar y aplicar una migración para la creación de la base de datos.
Para este paso se debe establecer una variable de entorno con el nombre "PG_CON_STR", y como valor una cadena de conexion válida para Postgresql.
dotnet ef migrations add Initial -p Persistence/ -s Api/
dotnet ef database update -p Persistence/ -s Api/
- Ejecutar el script "db_data.sql" sobre la base de datos creada (pgAdmin o DBeaver son buenas opciones), y ejecuta el proyecto:
dotnet run