Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Based on the basics of building a Web API with ASP.NET. and build on freely available CoinStat and CoinLore APIs

Notifications You must be signed in to change notification settings

DevelopmentGuide/API-Frontend

Repository files navigation

API Frontend

It deals with frontend logic required for WebApi of .NET Project

Requirements

  1. VS Code

  2. .NET 6.0

Commits

  1. .NET MVC Template

    Created by using following command

dotnet new mvc 
  1. Code Clean

  2. CoinStat API

// CoinStat Controller
[HttpGet]
public async Task<IActionResult> CoinStat_All()
{
    var response = await httpClient.GetAsync(Configuration.GetValue<string>("coinstat"));
    var content = await response.Content.ReadAsStringAsync();

    var Api = new List<Api>();
    // if (response.Content.Headers.ContentType.MediaType == "application/json")
    // {
    Api = JsonConvert.DeserializeObject<List<Api>>(content);
    // }
    return View(Api);
}
  1. CoinLore API
// CoinLore Controller
[HttpGet]
public async Task<IActionResult> CoinLore_Individual()
{
    var response = await httpClient.GetAsync(Configuration.GetValue<string>("coinlore"));
    var content = await response.Content.ReadAsStringAsync();

    var Api = new List<Api>();
    // if (response.Content.Headers.ContentType.MediaType == "application/json")
    // {
    Api = JsonConvert.DeserializeObject<List<Api>>(content);
    // }
    return View(Api);
}
  1. Final Changes

Start

To Start enter following command in terminal

dotnet run

Visit the following link

localhost:4000/

About

Based on the basics of building a Web API with ASP.NET. and build on freely available CoinStat and CoinLore APIs

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages