Skip to content

An Asp.Net Core Web API that provides access to games stored on a Mongo DB local instance

Notifications You must be signed in to change notification settings

logotie/GamesApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GamesApi

An Asp.Net Core Web API that provides access to games stored on a Mongo DB local instance.

The different branches I made, describe the different features and stage of work I was on

The entire JSON array collection used in the app, is displayed here:
https://raw.githubusercontent.com/logotie/GamesApi/master/GamesApi/defaultjson.json

Please clone the code and open the solution 'GamesApi.sln' using Visual Studio. I used Visual Studio 2019

There is a project for the API and another project for the XUnit tests.

APIs:
localhost:8080/games/{id}
Displays the game object with the id.

localhost:8080/games/?
Accepts any of the following query strings and returns a list of game objects

  • likesGreater - games that have a greater amount of likes than the specified number
  • platform - games that are publised on the platform
  • publisher - games that were published by a certain company
  • publishedAfter - games that were published after a certain epoch time (in seconds)
  • minAge - games that have a higher age rating than the specified number
  • maxAge - games that are have a lower age rating than the specified number
Example: http://localhost:8080/games/?platform=ps4&minage=1

localhost:8080/games/report
Displays a report similar to https://gist.github.com/divya051988/cfe18cbd24bbeec62eb2444ff55f3c34

On starting the web app:

  1. The JSON array is converted from JSON into a list of game objects
  2. The game objects are stored in a local temporary MongoDb instance
  3. The game objects are exposed via different APIs

External libraries used:

  • Microsoft.AspNetCore.App
  • Microsoft.AspNetCore.Mvc.Core
  • Microsoft.Net.Test.Sdk
  • Microsoft.AspNetCore.Razor.Design
  • Mongo2Go - Local instance for debugging
  • MongoCSharpDriver - Mongo DB driver
  • MongoDB.Driver - Mongo DB driver
  • Moq - For mocking objects when testing
  • Newtonsoft.Json - Json manipulation
  • xunit - creating unit tests
  • xunit.runner.visualstudio - displaying the unit tests in Visual studio

About

An Asp.Net Core Web API that provides access to games stored on a Mongo DB local instance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages