(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{119:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){returnc})),r.d(t,"metadata",(function(){returnl})),r.d(t,"toc",(function(){returnu})),r.d(t,"default",(function(){returns}));varn=r(3),o=r(7),a=(r(0),r(124)),i=r(126),c={id:"example_blazor",title:"Blazor ServerSide"},l={unversionedId:"example_blazor",id:"example_blazor",isDocsHomePage:!1,title:"Blazor ServerSide",description:"Description",source:"@site/docs/example_blazor.md",slug:"/example_blazor",permalink:"/SpotifyAPI-NET/docs/example_blazor",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/example_blazor.md",version:"current",lastUpdatedBy:"Daniele Maltese",lastUpdatedAt:1620233498,formattedLastUpdatedAt:"5/5/2021",sidebar:"docs",previous:{title:"Blazor WASM",permalink:"/SpotifyAPI-NET/docs/example_blazor_wasm"},next:{title:"CLI - Custom HTML",permalink:"/SpotifyAPI-NET/docs/example_cli_custom_html"}},u=[{value:"Description",id:"description",children:[]},{value:"Run it",id:"run-it",children:[]}],p={toc:u};functions(e){vart=e.components,r=Object(o.a)(e,["components"]);returnObject(a.b)("wrapper",Object(n.a)({},p,r,{components:t,mdxType:"MDXLayout"}),Object(a.b)("h2",{id:"description"},"Description"),Object(a.b)("p",null,"Very similar to the ",Object(a.b)("a",{parentName:"p",href:"/SpotifyAPI-NET/docs/example_blazor_wasm"},"Blazor WASM Example"),", but runs code on the server side and pushes view updates to the client."),Object(a.b)("img",{alt:"ASP Blazor Example - Home",src:Object(i.a)("img/asp_blazor_example_home.png")}),Object(a.b)("h2",{id:"run-it"},"Run it"),Object(a.b)("p",null,"Before running it, make sure you created an app in your ",Object(a.b)("a",{parentName:"p",href:"https://developer.spotify.com/dashboard/"},"spotify dashboard")," and ",Object(a.b)("inlineCode",{parentName:"p"},"https://localhost:5001")," is a redirect uri of it."),Object(a.b)("pre",null,Object(a.b)("code",{parentName:"pre",className:"language-bash"},"# Assumes linux and current working directory is the cloned repository\ncd SpotifyAPI.Web.Examples/Example.ASPBlazor\ndotnet restore\n\nSPOTIFY_CLIENT_ID=YourClientId SPOTIFY_CLIENT_SECRET=YourClientSecret dotnet run\n\n# Visit https://localhost:5001\n")))}s.isMDXComponent=!0},124:function(e,t,r){"use strict";r.d(t,"a",(function(){returns})),r.d(t,"b",(function(){returnb}));varn=r(0),o=r.n(n);functiona(e,t,r){returntine?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}functioni(e,t){varr=Object.keys(e);if(Object.getOwnPropertySymbols){varn=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){returnObject.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}returnr}functionc(e){for(vart=1;t<arguments.length;t++){varr=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}returne}functionl(e,t){if(null==e)return{};varr,n,o=function(e,t){if(null==e)return{};varr,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);returno}(e,t);if(Object.getOwnPropertySymbols){vara=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}returno}varu=o.a.createContext({}),p=function(e){vart=o.a.useContext(u),r=t;returne&&(r="function"==typeofe?e(t):c(c({},t),e)),r},s=function(e){vart=p(e.components);returno.a.createElement(u.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){vart=e.children;returno.a.createElement(o.a.Fragment,{},t)}},f=o.a.forwardRef((function(e,t){varr=e.components,n=e.mdxType,a=e.originalType,i=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),s=p(r),f=n,b=s["".concat(i,".").concat(f)]||s[f]||d[f]||a;returnr?o.a.createElement(b,c(c({ref:t},u),{},{c