GithubHelp home page GithubHelp logo

blazorrendermodes's Introduction

BlazorRenderModes

Screenshots

Configuration

Blazor has 5 render modes. SSR Server Side Render, SSR Streaming Rendering, Blazor Server with SignalR, Blazor Wasm, Blazor Auto. This repo has created demos for each render type.

The app has been built with the final release of .NET 8. To run this sample, you must download and install Visual Studio 17.8+ and the .NET 8 SDK.

Download Visual Studio https://visualstudio.microsoft.com/vs/

Download the SDK here https://dotnet.microsoft.com/en-us/download/dotnet/8.0

You will also need to get a TMDB API developer key. Follow this link to get a key https://developer.themoviedb.org/docs Note: TMDB will provide two keys - this sample uses the "Read Access Key" as a bearer token, not the "API Key" which must be appended as a query string.

To add your TMDB API key to the project you will navigate to the server project and edit program.cs You can add your key directly to the file or use user secrets like we did. We set the string variable with the value using a user secret.

// your TMDB Read Access key must be in the server's secrets.json, e.g.:
// "TMDBKey": "your-Read-Access-key-here"
// Alternatively, place your API key directly over builder.Configuration["TMDBKey"]
string? tmdbKey = builder.Configuration["TMDBKey"];

builder.Services.AddScoped(sp => {
    var client = new HttpClient();
    client.BaseAddress = new("https://api.themoviedb.org/3/");
    client.DefaultRequestHeaders.Authorization = new("Bearer", tmdbKey);
    return client;
});

Syntax example for User Secrets or appsettings.json:

{
  "TMDBKey": "your-Read-Access-key-here"
}

Blazor Overview Video

SSR Walkthrough Video

blazorrendermodes's People

Contributors

bdavisjr avatar jacobvisick avatar mattgoff avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.